• 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: Objective-C Instance Variable Names
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective-C Instance Variable Names


  • Subject: Re: Objective-C Instance Variable Names
  • From: "E. Wing" <email@hidden>
  • Date: Sun, 6 Apr 2008 16:54:23 -0700

> I just name the all my instance variables  "the_instance_var_" , and
> the local ones "theLocalVar", this keep me well informed about if X
> var is instance or local :).
>

I do something a little different. For member variables, I use
camelCase and for for local variables I use_underscores.

For Objective-C 2.0 properties and KVC compliance as a whole, this has
worked out quite nicely as I don't have to rename the accessor methods
or do anything extra.

@interface MyClass : NSObject
{
    NSString* firstName;
}
@property firstName;
@end

@implementation
@synthesize firstName;
// definition for show, gc-only
- (void) setFirstName:(NSString*)first_name
{
    firstName = first_name;
}
@end


-Eric
_______________________________________________

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

References: 
 >Objective-C Instance Variable Names (From: Richard Somers <email@hidden>)
 >Re: Objective-C Instance Variable Names (From: Jens Alfke <email@hidden>)
 >Re: Objective-C Instance Variable Names (From: "Rob Napier" <email@hidden>)
 >Re: Objective-C Instance Variable Names (From: Scott Andrew <email@hidden>)
 >Re: Objective-C Instance Variable Names (From: John Stiles <email@hidden>)
 >Re: Objective-C Instance Variable Names (From: Chris Suter <email@hidden>)

  • Prev by Date: Re: Objective-C Instance Variable Names
  • Next by Date: Re: KVC - how to get properties into a common form?
  • Previous by thread: Re: Objective-C Instance Variable Names
  • Next by thread: Re: Objective-C Instance Variable Names
  • Index(es):
    • Date
    • Thread