Thanks for your feedback!

> It might be a bit simplified, but I always advise to use nonatomic properties 
> for UI classes (controllers, views, etc) and atomic for model classes.

Hm, while you are less likely to use these in a way that would be problematic 
with nonatomic, it is still possible, so I'm not sure whether it's good advise. 
In general, recommending to just always use nonatomic, even if only for certain 
things, sounds like premature optimization.

> In general UI should be accessed only by the main thread (if not, you have 
> way more serious problems than atomic vs. nonatomic). With a lot of practice 
> one develops an intuition (for a lack of better word).

I think you might be misunderstanding the point I'm trying to make here, 
though: This is not about thread-saftey. This is about nonatomic even being 
unsafe if you only have a single thread.

Do you have an idea how I could rephrase it to make this more clear?

> You are correct, that for trivial tasks atomic properties are not slowing 
> down the app. But I found out that for scrolling intensive UIs this is not 
> the case.

That's interesting. Do you have an example of where this actually slowed you 
down?

Another way to get rid of the spinlock without using nonatomic is to just write 
the getter yourself as return [[foo retain] autorelease]. That does not come 
with all the problems mentioned, but also avoids the spinlock. I wonder if I 
should add that to the post?

--
Jonathan
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/objc-language/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to