• 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: Table column bindings question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Table column bindings question


  • Subject: Re: Table column bindings question
  • From: Carmin Politano <email@hidden>
  • Date: Sun, 22 Apr 2007 16:46:25 -0400

You are interested in binding to selectedObjects.
I have discovered that it is often necessary to add another NSArrayController which is bound to the selectedObjects of what is desired.
Then bind the desired-to-be-bound object to the content of that controller. Seems to be redundant but I have discovered more control doing it.


It also seems that you have an if issue: i.e.: if selected then use the selection otherwise use all.
Subclass the NSArrayController which you are binding to and add an instance method say: -pullDownManageds which will return the desired thing.
Bind to that metod (pullDownManageds) of the subclassed NSArrayController.
You will have to call -will/didChangeValueForKey: @"pullDownManageds" whenever the selectedObjects changes.
There is a class method which I never use which does this directly. In certain cases it works.
I always use -addObserver::: and -observeValueForKeyPath::: which works.


On Apr 22, 2007, at 3:10 PM, email@hidden wrote:

I have a core data project with three entities: Department, Manager, and Employee. The Department is set as a to-many relationship to Manager, and Manager is set as a to-many relationship to Employee. Department is also set as a to-many relationship to Employee, although I'm not sure if that is necessary. Inverse relationships also exist. In the nib file, the Manager array controller is bound to the content of the Department selection, and the Employee array controller is bound to the content of the Manager selection. I have a table of employees, and the 3 columns are employee name, manager, and department. Manager and department are popup menus.

What I want is when an employee in the table is selected, and the department popup menu is selected to a department, then only those managers associated with the department should appear in the manager popup. Change the department in the popup, and only those managers associated with the new department should appear. But it seems I can either display all the managers or none, regardless of what department is chosen in the department popup. I can't seem to set the manager table column bindings so that only those managers associated with the chosen department appear. Any assistance appreciated!

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
40verizon.net


This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Table column bindings question (From: email@hidden)

  • Prev by Date: Best format and method for very fast CGImage resizing
  • Next by Date: Re: Best format and method for very fast CGImage resizing
  • Previous by thread: Table column bindings question
  • Next by thread: Best format and method for very fast CGImage resizing
  • Index(es):
    • Date
    • Thread