"^Blocks"

So here's a little code snippet that illustrates another Objective-C syntactic abortion. If you need to use them because of the new iPhone 4 SDK (and you probably will at some point), here's a little code snippet of blocks in action:

#import <UIKit/UIKit.h>
#import <CoreMotion/CoreMotion.h>
#import <Foundation/Foundation.h>

@interface LowLevelViewController : UIViewController {
    CMMotionManager* cmm;
    NSOperationQueue* motionQueue;
}
@end
- (void) viewDidLoad
{
    cmm = [[CMMotionManager alloc] init];
    if(!cmm.accelerometerAvailable) {
        NSLog(@"Accelerometer not available");
    }
    else {
        cmm.accelerometerUpdateInterval = (double)1/50; //50Hz
        motionQueue = [[NSOperationQueue alloc] init];

        [cmm startAccelerometerUpdatesToQueue: motionQueue withHandler: ^( CMAccelerometerData* data, NSError* error) {
             NSLog(@"Accelerometer: %@", [data description]);
         }];
    }
    [super viewDidLoad];
}

- (void) dealloc {
    [motionQueue release];
    [cmm release];
    [super dealloc];
}

Look at that caret in viewDidLoad:!
Look at it!
Ugh!