开发者

Threading questions

  1. If I spawn a secondary thread and the threaded method calls other methods, are those methods r开发者_如何学JAVAun in the secondary thread or the main thread?

  2. Is there a way to determine on which thread a specified piece of code is being run?


  1. All method calls take place in the current thread, unless you do something like performSelectorInBackground:

  2. You can probably tell if you're running in the main thread by comparing [NSRunLoop currentRunLoop] to [NSRunLoop mainRunLoop]

See also: Threading Programming Guide

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜