• 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: Joanna Carter <email@hidden>
  • Date: Wed, 27 Apr 2011 17:09:44 +0100

Le 27 avr. 2011 à 16:52, Matt Neuburg a écrit :

> And Apple now exemplifies this pattern, e.g. in the app template for Window-based Application: there's a "window" property accessing a "_window" ivar. I think they do this just so you can't accidentally say "window" unqualified. m.

I also think that Apple is (finally) starting to use the @private and @protected visibility specifiers in templates which, although they are not as "strict" as in other languages, start to educate people not to use ivars directly.

I too would like to see a means of explicitly accessing the ivar, even if it has the same name as the property; although, I thought that not calling self.property from within the .m file defaulted to accessing the ivar if both it and a property existed?

Joanna

--
Joanna Carter
Carter Consulting

_______________________________________________

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

  • Follow-Ups:
    • Re: Properties vs Instance Variables
      • From: David Duncan <email@hidden>
References: 
 >Re: Properties vs Instance Variables (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: BSD TCP Programming on iPad
  • Next by Date: Window fringe, automatic guides
  • Previous by thread: Re: Properties vs Instance Variables
  • Next by thread: Re: Properties vs Instance Variables
  • Index(es):
    • Date
    • Thread