dispatch_async(dispatch_get_main_queue(), ^{
[self doSomething:1 b:2 c:3 d:4 e:5];
});
[ invocationObject performSelectorOnMainThread: @selector( invoke )
withObject: nil, waitUntilDone: NO ];
- (void)threadMain:(id)data {
NSAutoreleasePool *pool = [NSAutoreleasePool new];
NSRunLoop *runloop = [NSRunLoop currentRunLoop];
[runloop addPort:[NSMachPort port] forMode:NSDefaultRunLoopMode];
while (isAlive) { // '
[runloop runMode:NSDefaultRunLoopMode beforeDate:
[NSDate distantFuture]];
}
[pool release];
}
[self doSomething:1 b:2 c:3 d:4 e:5];
});
[ invocationObject performSelectorOnMainThread: @selector( invoke )
withObject: nil, waitUntilDone: NO ];
- (void)threadMain:(id)data {
NSAutoreleasePool *pool = [NSAutoreleasePool new];
NSRunLoop *runloop = [NSRunLoop currentRunLoop];
[runloop addPort:[NSMachPort port] forMode:NSDefaultRunLoopMode];
while (isAlive) { // '
[runloop runMode:NSDefaultRunLoopMode beforeDate:
[NSDate distantFuture]];
}
[pool release];
}