Is there a convention...
Is there a convention...
- Subject: Is there a convention...
- From: Jeff LaMarche <email@hidden>
- Date: Sat, 27 Jul 2002 21:26:46 -0700
This may be a bizarre question. When you have an object that you want to
be treated as a private member, the convention seems to be to start the
iVar's name with an underscore. This is the way that I've approached my
objective-C programs, and I generally do not include any
headerdoc-readable comments for my accessors and set methods.
However, I still create accessor methods and setter (is that the right
term) methods to make it easier to implement NSCoding and NSCopying. I'm
never sure how to name these methods, however. Is there a convention?
There seem to be a number of possible options. Let's assume an iVar:
NSImage *_myPrivateIVar;
I could see all of these being logical choices:
-(void)set_MyPrivateIVar;(NSImage *)inImage;
-(void)set_myPrivateIVar;(NSImage *)inImage;
-(void)setMyPrivateIVar;(NSImage *)inImage;
But I'm not sure which, if any, of these will work with valueForKey:.
Any thoughts or info on this would be appreciated, as I suspect I'm
using the wrong one.
Thanks.
- Jeff
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.