Re: Cross Nib communication
Re: Cross Nib communication
- Subject: Re: Cross Nib communication
- From: Chad Seldomridge <email@hidden>
- Date: Tue, 20 Feb 2007 08:29:11 -0700
In your MainMenu.nib, create an NSObjectController and name it
something useful like "DocumentContoller". Set the controller's
Object Class Name to the class of your document (e.g. MyDocument).
Bind the controller's contentObject binding to the File's Owner
(NSApplication) with a Model Key Path of mainWindow.document.
Now you have access to your document's KVC/KVO accessor methods
through this NSObjectController.
In your document (e.g. MyDocument.h/.m) make an accessor method to
expose your NSArrayController (e.g. - (NSArrayController *)
objectsArrayController ...)
Now back in your MainMenu.nib, create an NSArrayController and bind
its contentObject binding to DocumentController with Controller Key =
selection and ModelKeyPath = objectsArrayController.
Dance around the room.
chad
On Feb 20, 2007, at 3:50 AM, email@hidden wrote:
I have an instance of NSArrayController in
myDocument.nib that I expose through an IBOutlet in
myDocument, so that I can easily: NSLog(@"selection:
%@", [objectsArray selectedObjects];
I'd like to expose/bind this to a textview or some
such in mainmenu.nib. How would I achieve this. Or for
that matter have mainmenu.nib's appDelegate instance
access the aforementioned selectedObjects?
I'm having a bit of trouble understanding inter-nib
communication in a document-based situation using
CoreData, and am tripping up on a number of things,
including bindings.
Thanks.
_______________________________________________
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