Hi Brian, I've normally solved this using an integer for the value and enumerate that to stand for different states of the bug. I'm not sure if there's a clever way to use an enum in conjunction with core data, so it may become a headache to 'remember' what each value stands for, but if you only have a few states, then it should be straightforward. Then you bind the selectedIndex of the popup button, say, rather than the selectedObject.
Cheers, Martin On Aug 19, 2011, at 3:40 PM, Brian Norh wrote: > Hello. > > When I'm using Core Data I'm sometimes in a situation where I have an > attribute than can only have a specific set of possible values. As an > example let's say that you make a bug tracker and you have an entity > called Bug. Then it's possible that you want an attribute for the > state that the bug is in. Let's say that possible states are Open, > Closed and In Progress. > > What I've done so far is that I've had attributes like that defined as > strings. Usually I've had a combo box or a radio group in the user > interface and the possible input values have been defined by what the > possible selections the combo box or radio group offers. > > One of the problems with this approach is that it doesn't work if the > application is localized it into a different language. Then the word > which indicates the state is stored differently depending on the > current language. I need to save the selection in a language > independent manner. > > How would you do that? > > I've tried to find an answer in the Core Data Programming Guide and > I've also searched the list archives. I'm not really sure what the > appropriate terminology for this specific kind of attribute would be > so it could be that I'm just using the wrong search terms or I'm just > not looking at the right place. So if this question have already been > answered then a link to that thread or even a let-me-google-it-for-you > would be helpful. > > Brian > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please 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: > http://lists.apple.com/mailman/options/cocoa-dev/martin.hewitson%40aei.mpg.de > > This email sent to martin.hewit...@aei.mpg.de ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Martin Hewitson Albert-Einstein-Institut Max-Planck-Institut fuer Gravitationsphysik und Universitaet Hannover Callinstr. 38, 30167 Hannover, Germany Tel: +49-511-762-17121, Fax: +49-511-762-5861 E-Mail: martin.hewit...@aei.mpg.de WWW: http://www.aei.mpg.de/~hewitson ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com