• 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: Richard Somers <email@hidden>
  • Date: Mon, 7 Apr 2008 08:31:21 -0600


On Apr 5, 2008, at 7:17PM, Quincey Morris wrote:

The most common situation where I run into local/instance variable name conflicts is setter methods. If the property and the instance variable are both 'whatever', it makes sense to me to call the setter argument variable 'newWhatever', because that is in fact what it is.

This agrees with my experience. I have switched to simply using "newValue" for the setter argument variable. In other words I literally use "newValue" for the setter argument variable for all setter methods. Works well so far.


I also am training myself to pay attention to the color coding XCode 3 provides to distinguish ivars from local vars.

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


References: 
 >Re: Objective-C Instance Variable Names (From: Mario Gajardo Tassara <email@hidden>)
 >Re: Objective-C Instance Variable Names (From: "Dennis C. De Mars" <email@hidden>)
 >Re: Objective-C Instance Variable Names (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Is this a bug in Cocoa 'isLike' ?
  • Next by Date: Re: Objective-C Instance Variable Names
  • Previous by thread: Re: Objective-C Instance Variable Names
  • Next by thread: Bindings on Contextual Menu Items when to unbind:
  • Index(es):
    • Date
    • Thread