eugene
eugene

Reputation: 41665

(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 only 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

Upvotes: 1

Views: 336

Answers (1)

wm_eddie
wm_eddie

Reputation: 3958

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.

Upvotes: 1

Related Questions