Ios 来自核心数据的奇怪崩溃
我正在执行一个核心数据获取请求,如下所示:Ios 来自核心数据的奇怪崩溃,ios,core-data,Ios,Core Data,我正在执行一个核心数据获取请求,如下所示: AppDelegate *objAppDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate]; NSManagedObjectContext *moc= [[NSManagedObjectContext alloc] init]; moc.persistentStoreCoordinator = objAppDelegate.persistentStoreCoord
AppDelegate *objAppDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
NSManagedObjectContext *moc= [[NSManagedObjectContext alloc] init];
moc.persistentStoreCoordinator = objAppDelegate.persistentStoreCoordinator;
NSFetchRequest *request = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:PUSH_DATA_TABLE inManagedObjectContext:moc];
[request setEntity:entity];
NSError *error;
NSArray *arr = [moc executeFetchRequest:request error:&error];
但是应用程序在第NSArray*arr=[moc executeFetchRequest:request error:&error]行崩溃代码>但以下情况除外:
由于未捕获的异常“NSInvalidUnarchiveOperationException”而终止应用程序,原因:“-[NSKeyedUnachiver DecodeBoolWorkery:]:键(UIHighlighted)的值不是布尔值”
有人能帮我解决这个问题吗?这个问题是我自己解决的。我使用的是一个核心数据模型,其属性类型为transformable。我将dictionary对象分配给transformable type属性,在该属性中我设置了UIViewController对象。我猜,字典中设置的UIVIewController对象具有错误的键UIValue类型,突出显示为vadian。当我从字典中删除view controller对象时,崩溃得到了解决。此异常与CoreData无关,您确定该异常发生在excuteFetchRequest行吗?请不要在此处请求尽快/紧急-当您的听众主要由志愿者组成时,这是不合适的。他们可能会在闲暇时间讨论您的问题。错误消息显示,您的图形中有一个存档对象的keyui突出显示的值类型错误。