• 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: Coding conventions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Coding conventions (From: Bill Cheeseman <email@hidden>)

  • Prev by Date: Re: [OT] Bugreporter update - follow up
  • Next by Date: How to 'call' Shut Down?
  • Previous by thread: Re: Coding conventions
  • Next by thread: Re: Coding conventions
  • Index(es):
    • Date
    • Thread