Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Core data 删除托管对象时核心数据崩溃_Core Data_Ios5 - Fatal编程技术网

Core data 删除托管对象时核心数据崩溃

Core data 删除托管对象时核心数据崩溃,core-data,ios5,Core Data,Ios5,应用程序在保存上下文操作时崩溃。(情况是:我在tableView中执行segue,在destinationViewController中输入但甚至不修改任何内容,当我在tableView应用程序中输入并删除行时崩溃 CoreData: error: Serious application error. Exception was caught during Core Data change processing. This is usually a bug within an obser

应用程序在保存上下文操作时崩溃。(情况是:我在tableView中执行segue,在destinationViewController中输入但甚至不修改任何内容,当我在tableView应用程序中输入并删除行时崩溃

CoreData: error: Serious application error.  
Exception was caught during Core Data change processing.  
This is usually a bug within an observer of NSManagedObjectContextObjectsDidChangeNotification.  
-[__NSCFSet removeObject:]: attempt to remove nil with userInfo (null)
        *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFSet removeObject:]: attempt to remove nil'
迪马

很可能您正试图删除具有必需参数的类。请仔细检查您的模型或代码以满足您的实体要求。如果我的假设正确,您只需将关系设置为可选


Andrew

BTW:删除了所有数据库,但没有帮助。没有足够的信息继续。调试器转储是泛型的。你在使用线程吗?你在两个不同的线程上有多个上下文还是相同的上下文?堆栈中较高的代码会告诉我们更多。请看-我现在更正了后租约符号调用堆栈,wi通过一个人类可读的调用堆栈,可能会找到问题。您能否提供删除managedObject子类的代码以及监视通知的代码?不幸的是,没有。我发现在删除tableview中的行时会出现问题-只有在segue访问下一个ViewController之前,才会出现问题。
NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext];
        [context deleteObject:[self.fetchedResultsController objectAtIndexPath:indexPath]];
        // Save the context.
        NSError *error = nil;
        if (![context save:&error]) {
            NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
            NSLog(@"Unresolved error2 %@", [error localizedDescription]);
            abort();
        }