All data disappears (or is stored internally but is no longer visible) when the version is upgraded.
I made a terrible mistake.
I don't even know the cause.
I am not fiddling with the data model even when upgrading.
Currently,
as a candidate for the cause I'm thinking about
·As it is written in the book - (NSPersistentStoreCoordinator*) persistentStoreCoordinator
At the bottom of the , click [[NSFileManager defaultManager] removeItemAtURL:storeURL error:nil];
I left it as it says
·Because I didn't do the migration process
There is no confirmation regarding the two.I couldn't find a similar example when I googled.
Basically, AppDelegate is not fiddling with it, and everything except candidate 1 is as initial as it should be.
-(NSPersistentStoreCoordinator*) persistentStoreCoordinator{
// approximately
if(![ persistentStoreCoordinator addPersistentStoreWithType: NSSQLiteStoreType
configuration:nil URL:storeUrl
options:nil error:&error]) {
[[NSFileManager defaultManager] removeItemAtURL:storeURL error:nil]; // Add
NSLog(@"Unresolved error%@,%@", error, [error userInfo]);
abort();
}
return persistentStoreCoordinator;
}
I'm really sorry to all the users, and if you can recover the data,
I would appreciate it if you could tell me how to do that.
If you don't get the data back, please let me know how to deal with it so that it won't happen next time.
It's helpful.
Now I know the cause.
It was written here, but all the causes are still
[[NSFileManager defaultManager] removeItemAtURL:storeURL error:nil];
It seems that it was a group of .
This will delete the data.sqlite file, so when updating,
to take over the data.
I don't think so.
Thank you all for your reply.
925 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
579 Understanding How to Configure Google API Key
574 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
618 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.