문제

I am reading the Core Data Model Verisoning and Data Migration Programming Guide and am confused on how to set up the initial verison number.

I have an existing app in which I did not set it up for Core Data versioning. In addition, I am using Magical Record. The current version of the app is 1.3; I am ready to release 1.4 with some minor changes, and I want to change one of the Core Data entities (add new attributes) in release 1.5. I absolutely need versioning so my users will not lose any existing data. I assume I must set up the current verison to enable Lightweight Versioning for release 1.5.

The question is: does the Core Data version have to match the app version? or is that the common way for versioning to work?

도움이 되었습니까?

해결책

Magical record has a convenience method for this. In your AppDelegate where you setup magical record use.

[MagicalRecord setupCoreDataStackWithAutoMigratingSqliteStoreNamed:@"storeName"];

Alternatively click on your core data .xcdatamodeld then top bar Editor > Add Model Version

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top