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.
精彩评论