• 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: @property problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: @property problem


  • Subject: Re: @property problem
  • From: j o a r <email@hidden>
  • Date: Tue, 12 Feb 2008 10:48:40 -0800


On Feb 12, 2008, at 7:58 AM, Sean McBride wrote:

PS: To forstall an FAQ: Yes, it is kosher to use "_" as your ivar
prefix, even though the Foundation and AppKit classes do the same.
Name collisions are not a problem.

Could you elaborate? If I subclass NSView and add an ivar named "_sisterView" then in some future SDK NSView.h also gets a _sisterView ivar, wouldn't there be a compiler error?


Yes, and that's why I believe Jens is telling you that it's OK to use the same prefix for ivars as anyone else that you're sharing code with: Because any name clashes would be immediately apparent. This in contrast to, for example, method names.


Pity private ivars have to be in public headers...


Agreed, that is truly a pity.

j o a r


_______________________________________________

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: @property problem
      • From: Wade Tregaskis <email@hidden>
References: 
 >@property problem (From: Randall Meadows <email@hidden>)
 >Re: @property problem (From: "Kyle Sluder" <email@hidden>)
 >Re: @property problem (From: Brian Christensen <email@hidden>)
 >Re: @property problem (From: Jens Alfke <email@hidden>)
 >Re: @property problem (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: Repetitive Appending of Strings
  • Next by Date: Re: Repetitive Appending of Strings
  • Previous by thread: Re: @property problem
  • Next by thread: Re: @property problem
  • Index(es):
    • Date
    • Thread