• 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
[Newbie]:Bindings and pulldown menus
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Newbie]:Bindings and pulldown menus


  • Subject: [Newbie]:Bindings and pulldown menus
  • From: J Tichenor <email@hidden>
  • Date: Tue, 14 Sep 2004 17:46:51 -0700

I'm trying to bind the value of an NSArray to a pulldown menu. I have a value called projectTitles, which is a pointer to an NSArray of project titles, obviously, distilled out of the children of a masterProjectObject.

I am sure I am using proper KVC -- projectTitles exists both as a IBOutlet NSArray variable (don't think the IBOutlet matters for bindings?) and as a method which returns a pointer to the array.

In IB, I have created an NSArrayController object, added a projectTitles key, and then set the Object Class Name to my main data controller object, where the value of the projectTitles array is set and passed.

I have then bound the pulldown menu to the NSArrayController, in contentValues under bindings. I have set the controller key to be arrangedObjects and set Model Key Path to be projectTitles. I've fiddled around, trying different bindings, and am just not getting anywhere. I suspect it might have something to do with when my data model is loaded -- I have it in awakeFromNib -- but I assume that anytime that projectTitles value changes, the binding informs the pulldown menu to reload it's item list?

Anyway, I hope I've described this well enough. I know this is Bindings 101 but I've gone through both the Apple docs and mmalc's great but pretty advanced reference, so I'm at a bit of a loss. Suspect once I understand how this is done everything else should (hopefully) fall more smoothly into place? :-)

TIA.

~j~



James Tichenor
VFX Supervisor
AIM: email@hidden
(07779) 256 103
http://www.lehopictures.com/the_joint/


_______________________________________________ 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
  • Prev by Date: Re: Distributing vs. re-using source code?
  • Next by Date: Re: controlTextDidChange, backspace possible?
  • Previous by thread: noteFileSystemChanged: - Bug?
  • Next by thread: Re: [Newbie]:Bindings and pulldown menus
  • Index(es):
    • Date
    • Thread