• 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: Code error in Your First Mac App tutorial..
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Code error in Your First Mac App tutorial.. (From: Peter Teeson <email@hidden>)
 >Re: Code error in Your First Mac App tutorial.. (From: Ken Thomases <email@hidden>)
 >Re: Code error in Your First Mac App tutorial.. (From: Peter Teeson <email@hidden>)
 >Re: Code error in Your First Mac App tutorial.. (From: Conrad Shultz <email@hidden>)

  • Prev by Date: Re: Code error in Your First Mac App tutorial..
  • Next by Date: Re: iOS From 1,99 To 1.99
  • Previous by thread: Re: Code error in Your First Mac App tutorial..
  • Next by thread: Re: Code error in Your First Mac App tutorial..
  • Index(es):
    • Date
    • Thread