• 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: Synthesised properties and additional actions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Synthesised properties and additional actions
      • From: Ken Tozier <email@hidden>
References: 
 >Re: Synthesised properties and additional actions (From: Matt Neuburg <email@hidden>)
 >Re: Synthesised properties and additional actions (From: Joanna Carter <email@hidden>)
 >Re: Synthesised properties and additional actions (From: Matt Neuburg <email@hidden>)
 >Re: Synthesised properties and additional actions (From: Joanna Carter <email@hidden>)

  • Prev by Date: Re: Synthesised properties and additional actions
  • Next by Date: Proper removal of a NSStatusItem?
  • Previous by thread: Re: Synthesised properties and additional actions
  • Next by thread: Re: Synthesised properties and additional actions
  • Index(es):
    • Date
    • Thread