Update core data database in app update without migrating
I have an application in iTunes app store using core data. Currently I'm developing a new version that has a new core data model. I do not want to migrate the data when开发者_开发百科 updating. I just want to remove the old one and in with the new.
Whats the best way to handle this? My current (temporary?) solution is to change the path of the sqlite file which leaves the old database in the app.
Is there a migration option to remove the store if it can not be migrated, or some other solution?
I would probably check for the existence of the original database using NSFileManager and delete/remove it if found. The best place to do this is probably when you create the persistent store that Core Data uses.
精彩评论