Cross-nib bindings for to-many relationships
Cross-nib bindings for to-many relationships
- Subject: Cross-nib bindings for to-many relationships
- From: Scott McMahan <email@hidden>
- Date: Thu, 18 Aug 2005 21:35:32 -0700 (PDT)
I've got a follow up to my earlier question about
NSArrayController bindings.
I have a delegate connected to my mainmenu.nib that
reads in a plist and a NSArrayController that accesses
the array by binding to Shared Application
delegate.array. This works fine for to-one
relationships and pop up buttons.
Now I'm trying to set it up for a NSTableView that
allows multiple selections. The full contents of the
NSTableView are read in when mainmenu.nib loads using
the same binding as the to-one. I want the selected
items to bind to an array set up by the nib's File's
Owner.
The NSTableView shows the full list, but I can't
figure out how to easily bind the selected items to
document based array.
If it can't be done easily, can I make the document.m
file a delegate for the NSTableView and override its
tableViewSelectionDidChange method so that when the
selection changes I can programatically change the
document based array? Can I get the source array by
1) get the NSTableView by the object method of the
notification passed to tableViewSelectionDidChange
2) get the NSArrayController as the -dataSource of the
NSTableView
3) get an array of selected objects in the
NSArrayController by -selectedObjects.
Will this work or will the [MyTableView dataSource]
return the array itself instead of the controller? If
it will return the array, how could I find the
selected objects in the NSTableView?
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden