If the iOS App is using CoreData and has database updates on the previous version (new tables, fields, and so on), the migration of the CoreData database will be done when the installer is overwritten, as follows:
1. Select your Mydata.xcdatamodeld file, select menu Editor->add Model Version, such as name: Mydata2.xcdatamodel
2. Set the current version
Select Superior Mydata.xcdatamodeld, select the current template as Mydata2 in the versioned Core Data model in Inspector
3. Modify the new data Model MYDATA2, add fields and tables to the new file
4. Delete the original class file and regenerate the following class. (This step is not done)
In the Appdelegate
Nsdictionary *optionsdictionary = [nsdictionary dictionarywithobjectsandkeys:[nsnumber NumberWithBool:YES],
Nsmigratepersistentstoresautomaticallyoption, [NSNumber Numberwithbool:yes],
Nsinfermappingmodelautomaticallyoption, nil];
if (![ Persistentstorecoordinator Addpersistentstorewithtype:nssqlitestoretype
Configuration:nil
Url:storeurl
Options:optionsdictionary
Error:&error]) {
NSLog (@ "Failed to add persistent store with type to persistent store Coordinator");
}
Add *optionsdictionary, original Options:nil changed to Options:optionsdictionary
5. Recompile the program
After iOS modifies the CoreData data structure, the update installation will flash back