0

我正在尝试获取已保存到核心数据对象中的值,但是出现此错误

Use of undeclared identifier 'error'

这指向我在下面的代码和平中引用和错误的地方

// Test listing all FailedBankInfos from the store
        NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
        NSEntityDescription *entity = [NSEntityDescription entityForName:@"Manuf" inManagedObjectContext:context];
        [fetchRequest setEntity:entity];

NSArray *fetchedObjects = [context executeFetchRequest:fetchRequest error:&error];
        for (Manuf *manuf in fetchedObjects) {

           // Log all of the values in the object  

        }

任何帮助,将不胜感激

4

1 回答 1

4

您需要先声明错误,然后再将引用传递到executeFetchRequest.

像这样:

NSError *error;
于 2012-09-27T03:25:07.663 回答