我在蘋果提供的示例代碼中看到應該如何處理核心數據錯誤。即:iPhone核心數據「生產」錯誤處理
NSError *error = nil;
if (![context save:&error]) {
/*
Replace this implementation with code to handle the error appropriately.
abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. If it is not possible to recover from the error, display an alert panel that instructs the user to quit the application by pressing the Home button.
*/
NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
abort();
}
但從來沒有一個如何應該實現它的任何實例。
有沒有人有(或可以指向我的方向)一些實際的「生產」代碼,說明上述方法。
由於提前, 馬特
+1這是一個很好的問題。 –