What do I have to do to get Core Data to automatically migrate models?

前端 未结 10 1909
感情败类
感情败类 2020-11-27 09:14

I have read the documentation about automatic /lightweight migration for Core Data models - but I am having problems implementing it.

As I understand it the applicat

10条回答
  •  我在风中等你
    2020-11-27 09:35

    iOS 4.0+

    NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"model" withExtension:@"momd"];
    managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
    

提交回复
热议问题