Re: Objective-C Instance Variable Names
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