• 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: NSPopUpButton & Bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Newbie: NSPopUpButton & Bindings


  • Subject: Newbie: NSPopUpButton & Bindings
  • From: James Hillhouse <email@hidden>
  • Date: Tue, 4 Oct 2005 01:49:45 -0500

To demo how to make NSPopUpButtons work in Cocoa, I made a very simple Cocoa App called aptly enough "PopUpButtonDemo" that does nothing more that display someone's age when you select their name from the pop up button.

There is only one Class, PopMeUp. Some...well, ALL of the code for PopMeUp.h/m I copied from Malcolm's "ToDo" app Controller.h/m and then changed it. That was a bad idea because his works--mine doesn't.

Right now, on the UI I just have the NSPopUpButton on the Window because I wanted to see the list of names before I went off and made the problem more complicated.

I used an NSArrayController, PopUpController, because it's my understanding that a PopUpButton is handled like an array. The PopUpController has as its attribute the Class PopMeUp and a contentArray Binding to FileOwner Model Key Path "popUps". The NSPopUpButton itself is bound as follows:

- content to popupArrayController.arrangedObjects;
- contentValues to popupArrayController.arrangedObjects.displayName;


I did not Bind to

    - selectedObject to otherArrayController.selection.attribute

since there is no other object.

Keep getting an error:

[<NSApplication 0x3136e0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key popUps.

But I did create the NSArray popUps in PopMeUp.h. Huh...

Instead of boring this group with my baby question, is there someone I can do this off-line with? I know I'm doing something bone-headedly simple that someone who knows what they are doing could solve in a sec. I've
never done this before so I'm at a loss as to what I'm doing wrong.


Thanks

_______________________________________________
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: Crash within Cocoa with Guarded Malloc
  • Next by Date: Re: Where am I if I'm a .App package?
  • Previous by thread: Re: Crash within Cocoa with Guarded Malloc
  • Next by thread: Re: Shift key state on mouse motion or drag etc..
  • Index(es):
    • Date
    • Thread