NS(Array)Controller and To-Many Relationships (how to add objects from one to another)
NS(Array)Controller and To-Many Relationships (how to add objects from one to another)
- Subject: NS(Array)Controller and To-Many Relationships (how to add objects from one to another)
- From: アンドレ(Andre) <email@hidden>
- Date: Sat, 5 Feb 2005 12:42:59 -0800
Hi, just getting started with bindings (read almost all of the apple
docs)
and have a fairly good idea how bindings work (KVO/KVC/KVB) and
read up on NSController and NSArrayController etc. but I am having a
problem
to associate the objects in one NSArrayController to another.
Here is my object graph: NSArrayController containing the model
object that has a few to-one
properties, and one
that contains a to-many relationship (NSArray)
and another
NSArrayController that contains another model that I want
to insert into the
array in the first...
Put into easier terms, I have a table object (NSArrayController1) that
has some properties,
and then I have some column objects (NSArrayController2), now when I
add/insert objects
into Controller 2, I actually want it to go into
NSArrayController1.columns (or the current selection).
I am trying to override the add method on the second arraycontroller to
send it to table.columns (the NSArray)
but I wonder how to do this... with KVB?
(objectForKey:selection.column)? and then manually insert
it? Doesn't this short circuit validation because the NSArrayController
wouldn't manage one of the NSArray
it is holding?
Just wondering how other people handle to-many relationships and piping
the add actions of one
group of objects (displayed in a table view) to add to the selected
object(s) in another array?
Thanks for any help!
_______________________________________________
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