Re: Code error in Your First Mac App tutorial..
Re: Code error in Your First Mac App tutorial..
- Subject: Re: Code error in Your First Mac App tutorial..
- From: Peter Teeson <email@hidden>
- Date: Thu, 29 Dec 2011 22:50:03 -0500
On 2011-12-29, at 9:43 PM, Conrad Shultz wrote:
> "textField" is the name of the *property*. "_textField" is the name of
> the (private) *instance variable* (ivar) that is backing the property.
<snip>
Thanks Conrad for that full explanation which I now fully understand.
Actually the way I think of it now is that in this example "textField" is really the name of a *method*.
As Ken stated earlier it's merely an error in the tutorial code.
For which I'm very glad since It made me carefully re-read the Declared Properties chapter of OBJ-C 2.0.
One key thing to remember is that @property occurs in the method declaration list.
Another is that @synthesize generates accessor *methods*;
So that in the expression if (sender == self.textField){senderName = @"textField"; }
we are invoking the accessor method textField. As with any local method we need self.
My first use of Obj-C 2.0. Yippee I learned something today.
Thanks everyone.
_______________________________________________
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