Objective-C Instance Variable Names
Objective-C Instance Variable Names
- Subject: Objective-C Instance Variable Names
- From: Richard Somers <email@hidden>
- Date: Thu, 3 Apr 2008 10:29:41 -0600
There is a common practice of prefixing instance variable names with
"_", a single underscore character.
If Objective-C 2.0 properties are used this would result in dots
followed by underscores when invoking accessor methods with the dot
syntax. Not a desirable situation.
It appears that Apple as of Mac OS 10.5 uses properties only in Core
Animation classes and NSPointerFunctions.h with CALayer.h being the
single biggest user. Nowhere when Apple uses properties does it also
prefix instance variables with an underscore that I can find. Note
that NSPointerFunctions.h contains some very interesting property
examples.
It would appear then that the practice of practice of prefixing
instance variable names with an underscore character is becoming a
historical relic of the past.
Any comments?
Regards, Richard
_______________________________________________
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