In my iOS app - I have something called settings where I set the priority for X , Y ,Z ; eg: X = 30, Y = 60 , Z = 80.
which have some default value (X=50,Y=50 and Z =50) for the first time and untill user changes it to desired value.
Basically user can change the priority N number of times and whenever he changes I just need to update the default values with changed value.
What I need is to save the changed value so, that when he logs in next time he should see his changed values and not default values.
CoreData doesn't provide any facility to create default tuples when the database is setup. SO, for the user to see some default values which he can change the state in future and see the desired changed value whenever he logs in - he needs to create the database tuples with default values in it. This can be done by using a NSPredicate to check if you have the entry in the tuple and then creating it when result count is 0. Below I am checking if X is present in my DB, else I create all default tuples , because there is a check , it will be called only once in the whole application life cycle.