开发者

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];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜