Re: Accessing an NSArrayController in another NIB file
Re: Accessing an NSArrayController in another NIB file
- Subject: Re: Accessing an NSArrayController in another NIB file
- From: Claudio Mezzasalma <email@hidden>
- Date: Sat, 19 May 2007 11:28:46 +0200
- Resent-cc: email@hidden
- Resent-date: Sat, 19 May 2007 11:31:59 +0200
- Resent-from: Claudio Mezzasalma <email@hidden>
- Resent-message-id: <email@hidden>
- Resent-to: mmalc crawford <email@hidden>
Il giorno 19/mag/07, alle ore 02:47, mmalc crawford ha scritto:
On May 18, 2007, at 3:55 PM, Claudio Mezzasalma wrote:
Hello. As topic says, I'd need some help in binding to an
NSArrayController located in another NIB file. Exactly, here's the
scenario: I have a CoreData application, and I would need to bind
the NSArrayController's canRead key (located in MyDocument.nib) to
a main menu item (which is, obviously, located in MainMenu.nib);
at least, I assume that bindings are the mechanism i need to do
this. Am I wrong, or there's something I could actually do to this
stuff?
You almost certainly don't want to bind to "a main menu item in the
MainMenu.nib". You want to bind to whatever model value that affects.
If it's a preference, use NSUserDefaultsController. If it's
something else, find a keypath to it (NSApp's delegate is typically
useful here...).
mmalc
Let me add something i missed in the first message: my goal is to
replicate a button's behavior in the main menu as well. Since I used
a binding to enable/disable the button, according to
NSArrayController canRemove (sorry, canRead was a typo), I thought I
had to use the same mechanism.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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