Skip to content

Instantly share code, notes, and snippets.

@seanwolter
Created January 16, 2013 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seanwolter/4549216 to your computer and use it in GitHub Desktop.
Save seanwolter/4549216 to your computer and use it in GitHub Desktop.
NSOperation queue very basic example
// MyOperation.h
@interface MyOperation : NSOperation
@end
// MyOperation.m
@implementation MyOperation
- (void)main {
if ([self isCancelled]) {
NSLog(@"** operation cancelled **");
}
[self performSelectorOnMainThread:@selector(updateUserInterface) withObject:nil waitUntilDone:NO];
}
- (void)updateUserInterface {
some UI code
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment