开发者

adding a field to database without crashing the existing appstore app

开发者 https://www.devze.com 2023-04-10 22:48 出处:网络
I have a published app in the appstore. Recent changes to the app require me to add an extra field in the 开发者_如何转开发CoreData db.

I have a published app in the appstore. Recent changes to the app require me to add an extra field in the 开发者_如何转开发CoreData db.

If i do this without altering the other fields, will the update be succesful?

If not, how can i add a field to the db without damaging the app for the clients that already had the app?


You need to use Core Data Migration to do this. You should be able to do it with Lightweight Migration, which means it can be done automatically.

This is covered very well in a number of tutorials and examples. Here is a link. Look at the accepted answer to that question.

Here is another one: Can I use “Automatic Lightweight Migration” if my already release v1 didn't have a versioned Core Data model? That should set your mind at ease.

Here is a tutorial that is a little easier to digest.

I have used automatic lightweight migration, and it is painless for the type of change you are describing.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号