【发布时间】:2011-10-30 05:04:41
【问题描述】:
更改 NSManagedObject 的 BOOL 属性时发生崩溃。
保存对象的代码是:
self.detailItem.bookmark = [NSNumber numberWithBool:YES];
NSError *error = nil;
if (! [self.detailItem.managedObjectContext save:&error])
{
// Handle the error.
}
NSLog(@"%@", error);
还有错误:
Serious application error. Exception was caught during Core Data change processing. This is usually a bug within an observer of NSManagedObjectContextObjectsDidChangeNotification. The left hand side for an ALL or ANY operator must be either an NSArray or an NSSet. with userInfo (null)
2011-08-18 15:41:32.866 Codes[5260:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'The left hand side for an ALL or ANY operator must be either an NSArray or an NSSet.'
【问题讨论】:
-
您需要添加更多代码 - 您的 detailItem 是什么样的;它只是一个 NSManagedObject 吗?
-
是的,
detailItem只是一个 NSManagedObject,带有一个名为bookmark的 BOOL 属性。
标签: iphone objective-c cocoa-touch core-data crash