Re: NSArrayController bindings
Re: NSArrayController bindings
- Subject: Re: NSArrayController bindings
- From: mmalcolm crawford <email@hidden>
- Date: Thu, 22 Jul 2004 11:20:26 -0700
On Jul 22, 2004, at 11:08 AM, Philip Riggs wrote:
If I have an NSTableView outlet in a window and a controller object
such as:
NSArrayController* database1;
NSArrayController* database2;
IBOutlet NSButton* toggleDatabases;
How do I set up the controller to bind database1 or database2 to the
tableview, depending on the database the user chooses?
Send suitable bind:toObject:withKeyPath:options: messages to the table
columns:
<
http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Protocols/NSKeyValueBindingCreation.html>
<
http://developer.apple.com/documentation/Cocoa/Conceptual/
CocoaBindings/Concepts/HowDoBindingsWork.html>
It would probably be easier to put the table views onto a tab view and
toggle between them...
Or: Do the two arrays contain the same sort of object, just different
sets? If that's the case, then it's probably easier to use one array
controller and re-bind it to the other array when you toggle.
mmalc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.