Re: NSArrayController contentArray and add bindings
Re: NSArrayController contentArray and add bindings
- Subject: Re: NSArrayController contentArray and add bindings
- From: Matteo Rossi <email@hidden>
- Date: Fri, 22 Jul 2005 14:25:21 +0200
Now I add a master interface for employee entities (a table and
two buttons add/remove), BUT I want to display only the employees
assigned to the selected department. No problem: I create a
NSArrayController with a contentSet as selection.employees
[Department Array Controller]. The problem is "How can I implement
the Add button so that any new employee is automatically assigned
to the selected department ?" In fact, if I press Add, the
department relationship is set to nil by default and automatically
the new added item is not displayed since it doesn't belong to the
selected department.
The problem arises since I don't know how to correctly set the
value of the department relationship of the employee entity. Is it
possible to do this non programmatically ?
It's not clear why you think the employees are not added to the
relationship?
Re-reading this...
What is the action for your "Add" button? Have you implemented your
own add: action method? In which case, is there any reason not to
simply use the array controller's add: method?
mmalc
Thanks, you've found the solution. The problem was the Add action
which was bound to the Department array controller and not to the
selected department array controller: This way the added employee had
a nil department relationship.
Thanks again.
Matteo
_______________________________________________
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