开发者

Do I need to protect data structures on iPhone from callbacks and timers?

Do I need mutexes to protect my data structures acros开发者_运维问答s UI related callbacks and timer events?


What's accessing your data structures from cocoa touch? If you set data for a view, it's retained there and it's own copy is used. You really only have to worry about your own code.


All UI-related callbacks are on the main thread. Threads generated by UIKit and other iOS frameworks are generally hidden from the caller. As long as you don't generate threads of your own, you will seldom need to worry about this kind of locking when developing for iOS.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜