• 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
Use named constants, not literal strings (was Re: Please help. At wit's end binding NSPopupButtonCell selection)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Use named constants, not literal strings (was Re: Please help. At wit's end binding NSPopupButtonCell selection)


  • Subject: Use named constants, not literal strings (was Re: Please help. At wit's end binding NSPopupButtonCell selection)
  • From: Chris Hanson <email@hidden>
  • Date: Tue, 04 Nov 2008 08:42:19 -0800

On Nov 4, 2008, at 1:05 AM, Ken Tozier wrote:

Here's how I'm setting up the bindings

1. bind an NSArrayController (pageController ) to an NSArray of pages in a project
[pageController bind: @"contentArray" toObject: inProject withKeyPath: @"pages" options: nil];

One tip that has nothing to do directly with the issue you're requesting help with:


Never use a literal string for the binding name; always use the appropriate constant.

Thus the above should be:

[pageController bind:NSContentArrayBinding toObject:inProject withKeyPath:@"pages" options:nil];

The same is true for things like NSNotification names, various known NSDictionary keys, and so on -- if there's a named constant, use it, rather than make an assumption about what its value is.

  -- Chris

_______________________________________________

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: 
 >Please help. At wit's end binding NSPopupButtonCell selection (From: Ken Tozier <email@hidden>)

  • Prev by Date: Re: Get MD5 without crashing
  • Next by Date: Re: Xml
  • Previous by thread: Re: Please help. At wit's end binding NSPopupButtonCell selection
  • Next by thread: Re: Please help. At wit's end binding NSPopupButtonCell selection
  • Index(es):
    • Date
    • Thread