• 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: Properties vs Instance Variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Properties vs Instance Variables


  • Subject: Re: Properties vs Instance Variables
  • From: Kyle Sluder <email@hidden>
  • Date: Tue, 26 Apr 2011 21:23:10 -0700

On Tue, Apr 26, 2011 at 9:07 PM, Steve Christensen <email@hidden> wrote:
> I believe it's only necessary if you want to do a straight "@synthesize foo;", which would expect the instance variable to have the same name as the property.

And it's worth mentioning that you can always do @synthesize foo=_foo;
to map a property to an ivar with a different name.

Oh, how I wish Apple made it mandatory to access ivars using the
self-> syntax. Then I'd just name my ivars the same as my properties,
and not suffer the confusion of arguments/local variables, instance
variables, and properties all requiring different naming conventions.

--Kyle Sluder
_______________________________________________

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: 
 >Properties vs Instance Variables (From: Guy Steven <email@hidden>)
 >Re: Properties vs Instance Variables (From: Steve Christensen <email@hidden>)

  • Prev by Date: Re: Properties vs Instance Variables
  • Next by Date: Re: Properties vs Instance Variables
  • Previous by thread: Re: Properties vs Instance Variables
  • Next by thread: Re: Properties vs Instance Variables
  • Index(es):
    • Date
    • Thread