Use named constants, not literal strings (was Re: Please help. At wit's end binding NSPopupButtonCell selection)
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