• 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: Jim Correia <email@hidden>
  • Date: Sun, 6 Apr 2008 21:21:28 -0400

On Apr 6, 2008, at 8:18 PM, Michael Ash wrote:

Of course direct ivar access works with funny naming conventions. The
keys obviously have to share the funny naming convention, but this is
just mildly ugly, not any sort of showstopper. For proof, watch
Interface Builder not grind to a halt when you start prefixing all of
your IBOutlet names.

The IB runtime was perhaps a poor example :-), since it doesn't use KVC. (Yes, I have filed bugs that it should. I realize there are binary compatibility issues.)


Take, for example, an object with an iVar

		IBOutlet NSView *_containerView;

and the accessor methods

	- (void)set_containerView:(NSView *)view
	{
		_containerView = view;
	}

	- (void)setContainerView:(NSView *)view
	{
		_containerView = view;
	}

The first one will actually be used by the IB runtime since it doesn't have the same leading underscore magic that KVC does.

Jim
_______________________________________________

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: Jim Correia <email@hidden>)
 >Re: Objective-C Instance Variable Names (From: "Michael Ash" <email@hidden>)

  • Prev by Date: Re: NSTreeController KVO
  • Next by Date: Re: Objective-C Instance Variable Names
  • Previous by thread: Re: Objective-C Instance Variable Names
  • Next by thread: Re: Objective-C Instance Variable Names
  • Index(es):
    • Date
    • Thread