Le 27 avr. 2011 à 17:39, David Duncan a écrit : > @property(...) id foo; > @synthesize foo = _foo; > > Then the following holds: > _foo and self->_foo are equivalent means of direct ivar access. > self.foo = bar and [self setFoo:bar] are equivalent means of setting the > value of the property foo. > bar = self.foo and bar = [self foo] are equivalent means of getting the value > of the property foo. > > This remains true if you name the instance variable the same as the property, > but is typically considered more confusing. That is, if you use "@synthesize > foo", you can still access "foo" and "self->foo" identically to _foo and > self->_foo above.
It's OK, for some reason, I thought I had read that self->foo was no longer usable; my bad :-) Joanna -- Joanna Carter Carter Consulting _______________________________________________ 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