Xcode 4, Core Data Model Version - Set Current Ver

2019-01-16 01:47发布

I'm confused about how to perform the following function in Xcode 4 to set the model to use after creating a versioned model.

Design > Data Model > Set Current Version

7条回答
等我变得足够好
2楼-- · 2019-01-16 02:35

You can also use setter method from CoraData ...
Just do something like this...

In your CustomCoreDataManager.m:

#import "ObjectiveRecord.h"

and call the init method like this

- (instancetype)init {

    self = [super init];

    if (self) {           
        [[CoreDataManager sharedManager] setModelName:@"YourModelName"];
    }

    return self;
}
查看更多
登录 后发表回答