Can I use Automatic Easy Migration if my already released version of v1 does not have Core Data?

Is it possible to use "Automatic easy migration" if my already released v1 did not have a Core Data Model version?

If so, is there any key changed to the documented steps that I need to apply?

+5
source share
3 answers

Not only can you do this, in one sense it is the only way to do it. From Apple Documentation : "To create a model with a version, you start with a normal model ..."

v1 . , , , , - . v2 ( v1.1 - ). , v1, . , , v2 , , , , , . , .

? Apple :

, . (Core Data , NSBundles allBundles allFrameworks.) . , , , :

β€’
β€’
β€’ .

, . Xcode, ( NSEntityDescription, NSPropertyDescription). Xcode, , (. " Xcode" ). , setRenamingIdentifier:. ,

β€’ Car to Automobile,
β€’ " " paintColor

:

NSEntityDescription *automobile = [[destinationModel entitiesByName] objectForKey:@"Automobile"];
[automobile setRenamingIdentifier:@"Car"];
NSPropertyDescription *paintColor = [[automobile attributesByName] objectForKey:@"paintColor"];
[paintColor setRenamingIdentifier:@"color"];

, , Core Data.:) , , .

, , :

, XCode , v1, ? , v2?

, , . , v1 . , v2 , , , . .

, . , , , , , git ( , ). v2, , / v1 , (*. xcdatamodel file) , v1, . , .

, . , v1 v2, , , , , , , v2 .

+6

( .xcdatamodel).

. .xcdatamodel .xcdatamodeld. Finder, " ". - .xcdatamodel .xcdatamodel.

, , . , , !!!

, . CoreData , , , , .

+3

yes, it’s possible, because by creating a new version, you can also create a version mapping file. This file tells the application which keys will be changed, which keys in the new version (and, of course, which ones will be deleted and created)

apple documentation: http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/CoreDataVersioning/Articles/vmMappingOverview.html

+1
source

All Articles