1

I relased version 1 in appstore that contain coredata database , in version 2 I added new fields to the database how to modify dynamically the old database , with keeping the data

I already did without versioning and don't have the old version , and the application will crash on the customer ipad

any suggestion please

AMH
  • 6,363
  • 27
  • 84
  • 135

2 Answers2

4

take a look at the Core Data Model Versioning and Data Migration Programming Guide

thomas
  • 5,637
  • 2
  • 24
  • 35
  • I already did the chnages and submitted the new version without versioning the application crashed in cutomer ipad any solution, versioning require the old model to be exists – AMH May 22 '11 at 13:55
  • 1
    If it doesn't matter that the data stored in the v1-app is lost after an update to v2 then you can just use another storeurl. Then coredata checks if the new storeurl exists (after an app-update it doesn't). If it not: CoreData will create the new model and everything is fine (except of data-loss from v1-store). – thomas May 22 '11 at 14:10
  • the data is matter , and it's a big problem , and what do u mean by storeurl – AMH May 22 '11 at 14:13
  • storeurl = path to the sqlite-db (if sqlite-type used). So data-loss is not what you want. afaik it is also possible to migrate without versioning. I think the automatic lightweight migration should work. Description can be found in the link I postet in the answer. – thomas May 22 '11 at 14:36
1

I would encourage you to start using source control. XCode 4 has SVN and Git built in, you should give it a try - both are pretty easy to learn, and prepares you for when you need to have multiple people working on a project. Having your code in source control would have made this a straightforward problem to fix, you can get previous versions of any file at any point in time.

The WWDC 2011 videos have some good content on using source control effectively and efficiently as well.

Community
  • 1
  • 1
RyanR
  • 7,728
  • 1
  • 25
  • 39