Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: label URL



On 1/31/06, Andrew Thompson <email@hidden> wrote:
> Thanks for the code!  That helps.  I have a question though, I noticed
> in your library you preceded each variable with an underscore.  I
> assume this is so that classes inheriting from NSHiperLink will not
> conflict by using variables with the same name.

The use of underscore as a prefix for instance variables is not really
the best naming scheme to use, for one Apple reserves the use of
underscore for their own.

"Do not use the underscore character as a prefix meaning that the
instance variable is private. Apple reserves the use of this
convention because its use by third parties could result in name-space
collisions. See "Private Methods" for a suggestion on prefixes for
private API." -
<http://developer.apple.com/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingIvarsAndTypes.html#//apple_ref/doc/uid/20001284>

> My question is, couldn't you acheive the same result by making them private?

No, making them private doesn't put them in a separate namespace.

-Shawn
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >label URL (From: Andrew Thompson <email@hidden>)
 >Re: label URL (From: Andrew Thompson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.