• 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: ObjC 2.0, properties, KVC, special _ hacks etc.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ObjC 2.0, properties, KVC, special _ hacks etc.


  • Subject: Re: ObjC 2.0, properties, KVC, special _ hacks etc.
  • From: Negm-Awad Amin <email@hidden>
  • Date: Sun, 24 Aug 2008 18:22:35 +0200


Am So,24.08.2008 um 16:09 schrieb Thomas Engelmeier:


Am 24.08.2008 um 05:59 schrieb John C. Randolph:


On Aug 21, 2008, at 7:59 PM, Thomas Engelmeier wrote:


Am 22.08.2008 um 00:59 schrieb Dave MacLachlan:

Also, are the _ in front of member variables for Apple only (so we don't stomp on each other with member var names) or are they using them for the readability reason mentioned above? There is documentation where they have claimed _ at the beginning of method names as being Apple only, but nothing about method vars, and the KVC compliance docs seem to imply that it is fine to do.

Officially it is Apple only, but everybody and his dog uses it - in consistency to quite some Apple-provided samples.

Please file bugs when you see a sample that does so. A single leading underscore is an Apple internal coding convention, which should not be used for code samples. I did what I could to get those kinds of things fixed when I was there, but someone's got to file a bug for it to get noticed.

In this case I should probably first file feature requests
- for an additional naming convention proposal for ivars which for every other framework / platform I've seen (PowerPlant, MacApp, MFC, Java et al.) exist. My preference was a _trailing_ underscore which is also OK for C++ etc.


- automatic support for KVC for that ivar convention so not only Apple gets away with minimum accessor code to write (Jepp, I know @synthesize made it far easier)
You have KVC support for the underscore.
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Protocols/NSKeyValueCoding_Protocol/Reference/Reference.html#/ /apple_ref/occ/instm/NSObject/setValue:forKey:
Or did you mean support for another symbol?


Regards,
	Tom_E
_______________________________________________

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

Amin Negm-Awad email@hidden




_______________________________________________

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: 
 >Re: ObjC 2.0, properties, KVC, special _ hacks etc. (From: Thomas Engelmeier <email@hidden>)
 >Re: ObjC 2.0, properties, KVC, special _ hacks etc. (From: "John C. Randolph" <email@hidden>)
 >Re: ObjC 2.0, properties, KVC, special _ hacks etc. (From: Thomas Engelmeier <email@hidden>)

  • Prev by Date: Re: Core data entity creation design
  • Next by Date: Re: Nil Object Crashing KVO
  • Previous by thread: Re: ObjC 2.0, properties, KVC, special _ hacks etc.
  • Next by thread: Re: ObjC 2.0, properties, KVC, special _ hacks etc.
  • Index(es):
    • Date
    • Thread