Re: Memory Management and @synthesized accessors
Re: Memory Management and @synthesized accessors
- Subject: Re: Memory Management and @synthesized accessors
- From: mmalc Crawford <email@hidden>
- Date: Sat, 21 Feb 2009 11:17:38 -0800
On Feb 21, 2009, at 10:39 AM, Stuart Malin wrote:
So, I am curious as to why the default (retain) behavior of
@synthesize does just this?
This is specified by atomicity, not 'retain'.
"the goal of the atomic implementation is to provide robust accessors"
(<http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_5_section_6.html
>)
And, is there a way to tell @synthesize to use one of the other
approaches, or do I need to make such a property @dynamic and handle
the setter/getter myself?
Use nonatomic.
"If you specify nonatomic, then a synthesized accessor for an object
property simply returns the value directly."
<http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_5_section_3.html
>
mmalc
_______________________________________________
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