• 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: Specify valid values for a Core Data attribute
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Specify valid values for a Core Data attribute


  • Subject: Re: Specify valid values for a Core Data attribute
  • From: Martin Hewitson <email@hidden>
  • Date: Fri, 19 Aug 2011 16:02:07 +0200

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 (email@hidden)
>
> 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:
>
> This email sent to email@hidden

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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: email@hidden
WWW: http://www.aei.mpg.de/~hewitson
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

References: 
 >Specify valid values for a Core Data attribute (From: Brian Norh <email@hidden>)

  • Prev by Date: Specify valid values for a Core Data attribute
  • Next by Date: Re: Strange NSFileManager file replacement issue
  • Previous by thread: Specify valid values for a Core Data attribute
  • Next by thread: Re: Specify valid values for a Core Data attribute
  • Index(es):
    • Date
    • Thread