开发者

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

开发者 https://www.devze.com 2023-03-20 21:35 出处:网络
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 re

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

精彩评论

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