On Sat, Jun 18, 2011 at 10:16 PM, Dave DeLong <davedel...@me.com> 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to