I have a model named Store. In this I have attributes such as name, location, phone and so on. I want to sort the stores on Id´s like you do in SQL, however is this possible? Normally the frameworks add an auto Id for you. If Core Data does that how do I get a hold of the value, and is it possible to sort on this value?
Do I need to add a field to the model and handle this myself, which I do not want.
I saw something about using a Date field and let it have a default value of “NOW”, is this how you do it? In that case of do you add default value?
Sorting by id (or primary key) is an unsupported scenario. Please see CoreData: How to sort NSManagedObject by its primary key? for a similar, duplicate thread.