• 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: Class instance defaults: e.g. NSBrowser
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Class instance defaults: e.g. NSBrowser


  • Subject: Re: Class instance defaults: e.g. NSBrowser
  • From: Keary Suska <email@hidden>
  • Date: Wed, 17 Mar 2010 20:20:27 -0600

On Mar 17, 2010, at 4:11 PM, Andrew James wrote:

> I am a relative newbie to Cocoa so I trying to make sure that my code reflects Cocoa's coding culture.
>
> I'm interested in whether or not instances of Cocoa classes can be expected to display default behavior.  I'll use NSBrowser's - (BOOL)sendsActionOnArrowKeys as an example. In Apple's documentation there's no mention of the default.
>
> For my purposes, I want to make sure from release to release that my NSBrowser instance does send an action when up/down keys are used.  Does that mean as a Cocoa developer I'm content to always code [ myBrowser setSendsActionOnArrowKeys: YES ] ? or Make sure the appropriate box is checked in Interface Builder?

There is no hard and fast rule that I know of--that is Cocoa-specific. I would assert that as a general rule if you rely on a behavior, then you should always explicitly set it. It disambiguates your code and is future proof in case Apple decides to change the documented default. You may also want to file a bug against the doc.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

_______________________________________________

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: 
 >Cocoa Newbie Thread/Memory Problems (From: Dave <email@hidden>)
 >Re: Cocoa Newbie Thread/Memory Problems (From: Quincey Morris <email@hidden>)
 >Re: Cocoa Newbie Thread/Memory Problems (From: Dave <email@hidden>)
 >Re: Cocoa Newbie Thread/Memory Problems (From: Quincey Morris <email@hidden>)
 >Re: Cocoa Newbie Thread/Memory Problems (From: Dave <email@hidden>)
 >Re: Cocoa Newbie Thread/Memory Problems (From: Dave <email@hidden>)
 >Class instance defaults: e.g. NSBrowser (From: Andrew James <email@hidden>)

  • Prev by Date: Re: Case sensitive fileName
  • Next by Date: Re: NSTrackingArea Problem
  • Previous by thread: Class instance defaults: e.g. NSBrowser
  • Next by thread: Re: Cocoa Newbie Thread/Memory Problems
  • Index(es):
    • Date
    • Thread