• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Memory Management and @synthesized accessors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Memory Management and @synthesized accessors (From: Stuart Malin <email@hidden>)

  • Prev by Date: Memory Management and @synthesized accessors
  • Next by Date: Re: Memory Management and @synthesized accessors
  • Previous by thread: Memory Management and @synthesized accessors
  • Next by thread: Re: Memory Management and @synthesized accessors
  • Index(es):
    • Date
    • Thread