objcio / core-data

Sample code for the objc.io Core Data book
https://www.objc.io/books/core-data
MIT License
769 stars 197 forks source link

how to set primaryKey #56

Open coolboy-ccp opened 4 years ago

tkrajacic commented 4 years ago

You do no get access to a primary key. CoreData is not a database.

coolboy-ccp commented 4 years ago

Thanks! And would you know how to ensure that the model is not repeatedly inserted. Now I can only query to see if it exists, and then decide whether to update or insert it.

coolboy-ccp commented 4 years ago

I konw how to handle it already! Thank you!