使用未声明的标识符'NSMigratePersistentStoresAutomaticallyOption'

Mic*_*ray 4 core-data-migration ios5 uimanageddocument

当我在下面声明代码语句时,为什么会出现此错误?

使用未声明的标识符'NSMigratePersistentStoresAutomaticallyOption'

NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption, [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];
Run Code Online (Sandbox Code Playgroud)

为了让我能够识别我的NSMigratePersistentStoresAutomaticallyOption常量,我缺少什么?

谢谢,

麦克风

小智 6

NSMigratePersistentStoresAutomaticallyOption在NSPersistentStoreCoordinator.h中声明.您确定在构建该字典的地方(包括CoreData.h)包含或转发它吗?