Re: Synthesised properties and additional actions
Re: Synthesised properties and additional actions
- Subject: Re: Synthesised properties and additional actions
- From: Chris Parker <email@hidden>
- Date: Wed, 22 Jun 2011 11:18:48 -0700
On 22 Jun 2011, at 11:10 AM, Joanna Carter wrote:
>> My book is about iOS 4; there is no GC in that world! ☺
>
> Aha! Missed that bit <embarrassed>
>
> But was I finally right?
Consider the multi-threaded case where you want property access to be atomic (and remember, properties might not always be objects).
You still would like to take advantage of the locking behavior the @synthesized getter/setter pair offers you rather than writing it yourself.
The accessor synthesis doesn't just get you retain counting. Labeling and @property with the 'atomic' specifier can help in writing thread-safe accessors as well.
.chris
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden