Is that possible to set a primary key in CoreData iOS swift?

Solution:

There is no primary key available in coredata.It has more than a database.It will had relationShips and entities.

If you want to implement primary key then you can do onething to store an identifier with Integer and use it as primary key.But you cannot be set as primary key in coredata.

So you can do that fetch the data from coredata with predicate and check that identifier is available or not then save it in coredata.

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift