簡體   English   中英

從coredata對象讀取

[英]reading from coredata object

我正在嘗試獲取保存到核心數據對象中的值,但是卻出現此錯誤

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  

        }

任何幫助,將不勝感激

您需要先聲明錯誤,然后再傳遞對它在executeFetchRequest位置的executeFetchRequest

像這樣:

NSError *error;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM