bindings, coredata, NSPopUpButton
bindings, coredata, NSPopUpButton
- Subject: bindings, coredata, NSPopUpButton
- From: Eric Friedman <email@hidden>
- Date: Thu, 8 Sep 2005 16:16:51 -0700
I have an entity with an attribute that I wish to store as an integer value
in a bounded range. In the UI, this attribute is editable with a popup
button that can contain descriptive text labels for each of the possible
integral values. So, 1 = Red, 2 = Blue, 3 = Green.
Is there a way to use bindings so that the tag of the NSMenuItem selected in
the popup gets read/written in this attribute?
I realize that I can create another entity with my titles (Red, Blue, Green)
and then change the attribute into a relation to that entity, but that's not
going to work out very well when it comes to internationalization. Also, I
imagine that adding these additional tables is not going to be beneficial
w.r.t. performance (since I'd end up with a join for each relation).
Finally, I suspect that doing it this way would mean I'd have to write code
to sort the titles for the menuitems, since those would come back in an
unordered set. Binding NSMenuItem's tag to the attribute would allow the
localizable nib file to carry the titles in the correct sorted order.
What's the conventional wisdom for approaching this problem?
_______________________________________________
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