我在尝试保存时从核心数据中收到一条奇怪的错误消息但是错误不可重现的问题(在执行不同的任务时出现在不同的时间)
错误信息:
Unresolved error Domain=NSCocoaErrorDomain Code=1560 UserInfo=0x14f5480 "Operation could not be completed. (Cocoa error 1560.)", {
NSDetailedErrors = (
Error Domain=NSCocoaErrorDomain Code=1570 UserInfo=0x5406d70 "Operation could not be completed. (Cocoa error 1570.)",
Error Domain=NSCocoaErrorDomain Code=1570 UserInfo=0x14f9be0 "Operation could not be completed. (Cocoa error 1570.)"
);
}
Run Code Online (Sandbox Code Playgroud)
并且生成错误的方法是:
- (IBAction)saveAction:(id)sender {
NSError *error;
if (![[self managedObjectContext] save:&error]) {
// Handle error
NSLog(@"Unresolved error %@, %@, %@", error, [error userInfo],[error localizedDescription]);
exit(-1); // Fail
}
}
Run Code Online (Sandbox Code Playgroud)
这个消息的原因有什么想法吗?认为它出现在随机时间