• 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: Graham Cox <email@hidden>
  • Date: Sun, 19 Jun 2011 15:43:11 +1000

Thanks, I understand.

Seems to me if you are going to do this the advantages of @synthesize are virtually nil.

--Graham




On 19/06/2011, at 3:39 PM, Kyle Sluder wrote:

> On Sat, Jun 18, 2011 at 10:16 PM, Dave DeLong <email@hidden> wrote:
>> The instance variable is synthesized as well and has the same name as the property, so you should use that:
>>
>> -(void)setFoo:(id)newFoo {
>>  if (foo != newFoo) {
>>    [foo release];
>>    foo = [newFoo retain];
>>    [self doSomethingElseAsWell];
>>  }
>> }
>
> Note that if you override the setter for an atomic property, you must
> also override the getter, and you are responsible for enforcing the
> atomicity of the property. The compiler only recently added a check
> for this.
>
> --Kyle Sluder

_______________________________________________

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: Dave DeLong <email@hidden>
References: 
 >Synthesised properties and additional actions (From: Graham Cox <email@hidden>)
 >Re: Synthesised properties and additional actions (From: Dave DeLong <email@hidden>)
 >Re: Synthesised properties and additional actions (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Synthesised properties and additional actions
  • Next by Date: Re: Synthesised properties and additional actions
  • Previous by thread: Re: Synthesised properties and additional actions
  • Next by thread: Re: Synthesised properties and additional actions
  • Index(es):
    • Date
    • Thread