On 27 Mar 2009, at 18:31, WT wrote:

First, thanks to all who responded to my question.

On Mar 27, 2009, at 6:34 PM, Quincey Morris wrote:

The 'foo' in 'self.foo' is a property. The 'foo' in 'just foo' is *not* a property, but an instance variable. It's really important to know that the two are entirely different things, even when they are named the same. Whether the property foo even uses an instance variable foo is an implementation detail of your class. A property *may* be implemented using an instance variable for its storage requirements, and the instance variable *may* have the same name as the property, but neither of those things are requirements.

I have trouble understanding the above. How can a property be implemented, if not by using an instance variable?

If you're a Java programmer, it might help to think of the objective C property like this:

bar = self.foo;   // is equivalent to bar = this.getFoo();
self.foo = bar;   // is equivalent to this.setFoo(bar);





Incidentally, the syntactic equivalent of Java's 'this.foo' is probably Objective-C's 'self->foo',

Yes.
_______________________________________________

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/adc%40jeremyp.net

This email sent to a...@jeremyp.net

_______________________________________________

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