• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSArrayController bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >NSArrayController bindings (From: Philip Riggs <email@hidden>)

  • Prev by Date: NSData being retained?
  • Next by Date: Re: NSData being retained?
  • Previous by thread: NSArrayController bindings
  • Next by thread: Re: NSArrayController bindings
  • Index(es):
    • Date
    • Thread