Re: Binding To Array Controller From A Different XIB?
Re: Binding To Array Controller From A Different XIB?
- Subject: Re: Binding To Array Controller From A Different XIB?
- From: I.Savant <email@hidden>
- Date: Thu, 29 Oct 2009 14:26:27 -0400
On Oct 29, 2009, at 1:57 PM, Quincey Morris wrote:
The natural mechanism for controlling the appearance of such a menu
item (including its text, its check mark and its enabled state) is
to use interface validation (validateUserInterfaceItem: or
validateMenuItem:) in each possible controlling class.
The controlling object in this case, where the dependency is
ultimately on a NSArrayController property, is likely to be either
the NSDocument subclass, or the relevant window controller (set as a
window delegate to get it into the NSResponder chain).
Of course you're right that it would probably be easier for menus.
It is definitely cleaner from an architectural standpoint to have one
point of entry to your the abstract idea of "the active document" from
the menu system.
The approach I mentioned is far more useful for, say, a shared
"Inspector" pane, whose UI reflects something about the active
document (or some selected item therein). But as I said in my
response. It's possible and even easy in some cases do do as the OP
requested. :-)
--
I.S.
_______________________________________________
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