Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)methodToRunInBackgroundThread:(id)object {
- // Create this thread's pool
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- // Do stuff here...
- // And when you're done you'll probably want to update your view but you have to do that on the main thread
- // Bundle up whatever you're sending into a NSArray or something and pass that to another method
- [self performSelectorOnMainThread:@selector(doOnMainThread:) withObject:@"stuff" waitUntilDone:NO];
- // Release the pool, thread is done
- [pool release];
- }
Add Comment
Please, Sign In to add comment