• 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: combo box and objects?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: combo box and objects?


  • Subject: Re: combo box and objects?
  • From: Steven Kramer <email@hidden>
  • Date: Fri, 3 Jun 2005 17:38:59 +0200


Op 3-jun-05 om 4:08 heeft T Reaves het volgende geschreven:


On Jun 2, 2005, at 4:51 PM, Steven Kramer wrote:

Bindings already does this for you, using the contentObjects and contentValues bindings. Where the latter is used as the display value, naturellement.

If you're doing this by hand (I mean using a datasource), search the docs for an article "Providing Data for a Combo Box". You need an NSFormatter.

Regards,

Steven Kramer



When I do that, and I click the combo box, I get [MyClass copyWithZone:]: selector not recognized' exceptions. It's bound to an NSArrayController fronting a CoreData object. That error is - it's my understanding - indicative of a message sent an object that has been released. As it's a core data object, I'm not sure what's going on.

When I set it up to use a datasource, and do all the work in code, it works fine. I just can't seem to get it to work with bindings.


If the error reports 'MyClass' then the combo box is trying to use a MyClass instance as a value, i.e. one of the labels. Did you bind contentValues using a different keypath then contentObjects? Or did you use a custom formatter on contentObjects?


Also, you can't use 'description' as a keypath. Perhaps I'm repeating information you know already, but the typical setup is
boundObjects: arrayOfMyClassController.arrangedObjects
boundValues: arrayOfMyClassController.arrangedObjects.stringRepresentationMethod


(note you don't *need* a controller, simply using array works fine for me)


Good luck!

Regards,

Steven Kramer

--
email@hidden
http://www.sprintteam.nl/

_______________________________________________
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


References: 
 >Re: combo box and objects? (From: Steven Kramer <email@hidden>)
 >Re: combo box and objects? (From: T Reaves <email@hidden>)

  • Prev by Date: Re: ScreenSaverView/NSQuickDrawView/Opaque issue [update]
  • Next by Date: 2 QTMovieViews from 1 QTMovie?
  • Previous by thread: Re: combo box and objects?
  • Next by thread: linking to a styled private framework
  • Index(es):
    • Date
    • Thread