Re: NSPopUpButtonCell bindings help
Re: NSPopUpButtonCell bindings help
- Subject: Re: NSPopUpButtonCell bindings help
- From: Keary Suska <email@hidden>
- Date: Wed, 25 Apr 2007 17:49:42 -0600
- Thread-topic: NSPopUpButtonCell bindings help
on 4/24/07 3:35 PM, email@hidden purportedly said:
> No, you're missing the point. The "repeats" object -does- exist in the
> contentObjects array. They're both NSNumbers, both with the same
> value, both with the same memory address. It's the same object in both
> places.
Sorry about that--I didn't get that you were referring to "repeats". Anyway,
it appears that NSNumber caches constant values, so it returns the same
object every time for the same constant value--at least when using
+numberWithInt:. I wouldn't have expected that.
>> Your best bet is likely to have a particular class and arraycontroller to
>> manage the popup content. The trick then is making sure that every "repeats"
>> object is matching object from this special class. Throw in a transformer
>> for the contentValues binding to get the special display that you want.
>
> If there's a way to do this, I still haven't figured it out, and a
> working example would really be appreciated. I've tried every
> iteration I can think of to bind only content (and skip
> contentObjects), and only display via contentValues, but I cannot get
> it to work.
It can be, but, using your test case example, you would have to sacrifice
the dynamic value formatting--e.g. "Comes First" instead of "Foo Comes
First". I don't know what your actual application does, but in the test case
the formatting creates redundant info. I can provide more info on this
solution, if you could use it.
You might be able to use a combo box for what you want, but it may not be as
pretty, and it might not work either.
> I'm still convinced it's a bug (and, as said, the bug report has been filed).
I see now what you are looking at, and AFAICT it should work as you
expected. It seems that the controller wants the selected object to exist
in, or at least be the same "type" of object as, the content binding. Looks
like a bug to me too.
Best,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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