(iphone) is it safe to access UIView's data member from background thread?
I know that you can't update UIView from background view.
But not sure if that rule applies when I'm o开发者_运维技巧nly accessing custom data member variable of UIView descendants.
Suppose I have
@interface MyView : UIView
{
NSNumber* number;
}
@property (retain) NSNumber* number;
Here, does accessing the "number" variable from background thread violate the rule "no UIView update from background thread" ?
Thank you
Accessing your subclasses properties in a background thread shouldn't cause any problems if they are marked as atomic (the default). You have to make sure that you don't call any UIView methods that cause drawing though.
精彩评论