• 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 with Combo Boxes, etc.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArrayController with Combo Boxes, etc.


  • Subject: Re: NSArrayController with Combo Boxes, etc.
  • From: "Kent A. Signorini" <email@hidden>
  • Date: Sun, 11 Jan 2004 11:11:24 -0700

mmalc,

Thanks for your help but I just can't get something to work and I think you might be able to help me. I read your great help page but I still can't figure one thing out.

OK, I now have two array controllers bound to the same content array. The main one is controlled by a table--call this combatantController. The other one is called targetController (I have not added filtering yet, but I will do so later--for now it just lists the same names as the original controller does).

First off, I've decided to use an NSPopupButton instead of Combo Box (makes more sense). What I need to happen is when I choose a name from the Popup I need the shield rating to be displayed in a text field for the Combatant (which now happens to be a target) chosen in the Popup.

The problem is that I cannot seem to get this to work. I just don't know what I should bind to what in the Popup's bindings. The shield rating text field has been bound to selection.shieldRating as you suggested (of the targetController). But I can't get the popup to set the selection index of the array controller and so the shield rating text field always shows "No Selection".

How do I setup the bindings to get this work properly--so that choosing a target name in the Popup changes the selected object in the targetController?

Thanks so much,
Kent!



On Jan 10, 2004, at 10:06 PM, mmalcolm crawford wrote:

On Jan 10, 2004, at 8:38 PM, Kent A. Signorini wrote:

In another NSComboBox in my document, I want the data to be the names
of all the combatants controlled by the NSArrayController EXCEPT the
one that's currently selected.

I *think* you should be able to do this using a custom array controller that uses the same content array as the first, but which filters out its (the first's) selection (make an appropriate binding) -- for an example of filtering see:
<http://homepage.mac.com/mmalc/CocoaExamples/controllers.html>

Now, based on the name chosen in that combo box, another NSTextField
will display this second combatant's shield rating variable value.

That will simply be selection.shieldRating (FilteredArrayController)

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.
_______________________________________________
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.

  • Follow-Ups:
    • Re: NSArrayController with Combo Boxes, etc.
      • From: "Kent A. Signorini" <email@hidden>
References: 
 >NSArrayController with Combo Boxes, etc. (From: "Kent A. Signorini" <email@hidden>)
 >Re: NSArrayController with Combo Boxes, etc. (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: Extremely confused, GWorlds and CopyBits
  • Next by Date: Reusing the last viewed directory
  • Previous by thread: Re: NSArrayController with Combo Boxes, etc.
  • Next by thread: Re: NSArrayController with Combo Boxes, etc.
  • Index(es):
    • Date
    • Thread