/* NSObject+PWObject.h */

#import <Foundation/Foundation.h>


@interface NSObject (PWObject)

- (void)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay;

@end


/* NSObject+PWObject.m */

#import "NSObject+PWObject.h"


@implementation NSObject (PWObject)

- (void)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay
{
	int64_t delta = (int64_t)(1.0e9 * delay);
	dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delta), dispatch_get_main_queue(), block);
}

@end

A category for NSObject which makes running delayed blocks easy as pie. I use this a lot instead of NSTimers. Requires iOS 4 or Mac OS X 10.6.

Usage:

#import "NSObject+PWObject.h"

// ...
[self performBlock:^{ NSLog(@"Meep, meep!"); } afterDelay:10.0f];
// ...