Skip to content

Instantly share code, notes, and snippets.

@taka328w
Created April 28, 2012 14:18
Show Gist options
  • Save taka328w/2519395 to your computer and use it in GitHub Desktop.
Save taka328w/2519395 to your computer and use it in GitHub Desktop.
NSObject+Extensions.m
#import "NSObject+Extensions.h"
@implementation NSObject (Extensions)
- (void)performBlockInBackground:(VoidBlock)block {
[self performSelectorInBackground:@selector(executeBlockInAutoReleasePool:) withObject:[block copy]];
}
- (void)executeBlockInAutoReleasePool:(VoidBlock)block {
@autoreleasepool {
block();
[block release];
}
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment