您的位置:首页 > 移动开发 > IOS开发

iOS CoreData应用升级需要注意的地方

2011-07-20 17:13 393 查看
如果你的app运用了CoreData技术,那么在你修改了DB字段以后,再在旧版本上升级为新版本时会crash. 因为升级只升级了应用app,没有升级目录下的db文件。如果是开发当中,只需要deleate app再install一次。如果是上传到appstore的软件,那你可要小心处理了,没有经过migrate处理的app,用户升级后必然会crash.
所需要的技术就是CoreData versioning and migrate.
http://developer.apple.com/library/ios/#documentation/cocoa/conceptual/CoreDataVersioning/Articles/vmLightweight.html

http://iphonedevelopment.blogspot.com/2009/09/core-data-migration-problems.html

http://mobile.tutsplus.com/tutorials/iphone/core-data_schema-versioning-and-lightweight-migrations/

Lightweight Migrate 只支持轻量级的db修改,如:insert/update/delete 属性,表,  如果是更复杂的数据迁移,如某个属性*30%迁移到新model,则需要mapping model
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ios