How to use performSelector:
How to use performSe开发者_如何学编程lector:onThread:withObject:waitUntilDone:? here in onthread i have to use other thread not main thread. How to create other thread? give me some sample code.
Unless you have a thread pool to manage, it's easier to use -performSelectorInBackground:…
:
[object performSelectorInBackground:@selector(method:) withObject:foo];
If you're going to create a thread, use
NSThread* thread = [[NSThread alloc] init];
[object performSelector:@selector(method:)
onThread:thread
withObject:foo
waitUntilDone:YES];
[thread release];
精彩评论