PL

New Releases: PLBlocks 1.0 and PLCrashReporter 1.0 (and more!)

September 6, 2009, by Landon Fuller

PLBlocks 1.0

Plausible Blocks (PLBlocks) provides a drop-in runtime and toolchain for using blocks in iPhone 2.2+ and Mac OS X 10.5 applications. Both the runtime and compiler patches are direct backports from Apple’s Snow Leopard source releases.

The final 1.0 release includes two fixes for issues reported against the beta release:

  • Fixed support for using pre-compiled headers with blocks.
  • Work-around for rdar://7189835 – Xcode rewrites all occurrence of ‘gcc’ in a
    compiler path when linking using g++

We’re now using PLBlocks 1.0 for our own internal and client projects. The updated SDK is available for Leopard and Snow Leopard from the PLBlocks project page.

If you’d like to read more about using blocks in your own software, we recommend:

PLCrashReporter 1.0

Plausible CrashReporter provides an in-process crash reporting framework for use on both the iPhone and Mac OS X.

  • iPhone 3GS-optimized (armv7) binaries
  • Mac OS X 10.5+ PowerPC and experimental x86-64 support.

The latest release may be downloaded from the PLCrashReporter project page.

Since crash reports are handled internally to your iPhone application, it supports crash reporting for in-development application versions, allows users to provide additional feedback when submitting a report, and even provides the opportunity to inform users of known issues and the need to upgrade.

If you’d like to include PLCrashReporter in your own application, we recommend perusing some of the open-source usage examples:

PLDatabase 1.2.1

Plausible Database is an SQL database access library for Objective-C, initially focused on SQLite as an application database. The library supports both Mac OS X and iPhone development.

The new 1.2.1 release includes:

The latest release may be downloaded from the PLDatabase project page.

PLInstrument 1.0

This is the first release of PLInstrument, a reproducible instrumentation library modeled on xUnit. The library is intended to facilitate the instrumentation of performance critical code, and provide easily comparable results over the lifetime of the code base.

We use PLInstrument to provide reproducible measurements of performance critical sections in our applications and libraries.

The 1.0 release may be downloaded from the PLInstrument project page.

Example Usage

// If for some reason you wanted to measure the runtime of
// CGAffineTransform
- (PLInstrumentResult *) instrumentMirrorTransform {
    PLIAbsoluteTime start, finish;
    int iterations = 25000;

    start = PLICurrentTime();
    for (int i = 0 ; i < iterations; i++) {
        CGAffineTransform mirrorTransform;
        mirrorTransform = CGAffineTransformMakeTranslation(0.0, 200.0f);
        mirrorTransform = CGAffineTransformScale(mirrorTransform, 1.0, -1.0);
    }
    finish = PLICurrentTime();

    return [PLInstrumentResult resultWithStartTime: start
                                           endTime: finish iterations: iterations];
}

Results:

Instrumentation suite 'PLCoreGraphicsDemoInstruments' started at
    2008-12-20 18:51:46 -0800
Instrumentation case -[PLCoreGraphicsDemoInstruments instrumentMirrorTransform]
    completed (0.710000 us/iteration) at 2008-12-20 18:51:46 -0800
Instrumentation suite 'PLCoreGraphicsDemoInstruments' finished at
    2008-12-20 18:51:53 -0800