4

我在下面声明代码语句时怎么会出现这个错误?

使用未声明的标识符“NSMigratePersistentStoresAutomaticallyOption”

NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption, [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];

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

谢谢,

麦克风

4

1 回答 1

6

NSMigratePersistentStoresAutomaticallyOption 在 NSPersistentStoreCoordinator.h 中声明。您确定在构建该字典的任何地方都包含或转发了它(例如通过包含 CoreData.h)?

于 2012-03-07T16:40:43.097 回答