Re: Coding conventions
Re: Coding conventions
- Subject: Re: Coding conventions
- From: "Erik M. Buck" <email@hidden>
- Date: Mon, 29 Oct 2001 09:23:44 -0600
>
Apple reserves the leading underscore for its own private headers, to help
>
avoid namespace conflicts (you wouldn't want to unknowingly override a
>
private Apple variable). Apple has specifically (but informally) requested
>
that the rest of us not use leading underscores.
A good compromise is to use a leading underscore AND a unique prefix for
private/protected instance variables and methods.
@interface MYObject : NSObject
{
int _myIntValue; // example of protected instance variable
}
@end
@implementation MYObject
- (void)_myMethod; // example private method declaration
@end