• 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: Unique data in Core Data?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unique data in Core Data?


  • Subject: Re: Unique data in Core Data?
  • From: Paul Collins <email@hidden>
  • Date: Wed, 21 Jun 2006 09:57:45 -0700

On Jun 21, 2006, at 8:38 AM, Andrew Kinnie wrote:

I am curious whether there is a quick and easy way to create unique data in a Core Data app.

If you're looking for something like the "unique" flag in MySQL, I'm not aware of any equivalent in Core Data. But there is a validation system you can put your own methods in, so you can programmatically ensure the uniqueness of new entries. Best thing I can think of is to fetch with the new string and see if it exists. Read the "Validation" section of Core Data Programming Guide.


FYI, for a serialized attribute (1, 2, 3, ...) I keep a separate, 1- entry table with integer attributes like "nextID" with the next serial number to use for that persistence stack.

Paul Collins
_______________________________________________
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: 
 >Unique data in Core Data? (From: Andrew Kinnie <email@hidden>)

  • Prev by Date: Re: Unique data in Core Data?
  • Next by Date: Re: Crash while getting the NSColor components
  • Previous by thread: Re: Unique data in Core Data?
  • Next by thread: cocoa bindings causing crash
  • Index(es):
    • Date
    • Thread