Core data 线程1:断点1.1

Core data 线程1:断点1.1,core-data,crash,Core Data,Crash,在[context save:&error]方法上,我得到了这个错误,但并不总是这样。它随机崩溃 没有错误描述。 XCode 9.2,ios 10.3.3 我该怎么办 代码: } 什么错误,我只看到断点?谢谢。我没有补充这一点。这是随机发生的。可能是xcode错误吗?请删除所有断点,清理并重新生成项目。没有保证,但希望能有所帮助。 -(void)changeReadStatusOfConversationWithConvID:(int)convID isRead:(BOOL)isRead{ N

在[context save:&error]方法上,我得到了这个错误,但并不总是这样。它随机崩溃

没有错误描述。 XCode 9.2,ios 10.3.3 我该怎么办

代码:

}


什么错误,我只看到断点?谢谢。我没有补充这一点。这是随机发生的。可能是xcode错误吗?请删除所有断点,清理并重新生成项目。没有保证,但希望能有所帮助。
-(void)changeReadStatusOfConversationWithConvID:(int)convID isRead:(BOOL)isRead{

NSManagedObjectContext *context = [[AppDelegate sharedAppDelegate] managedObjectContext];

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"conversation_id == %d", convID];
NSArray *conversations = [self getObjectsForMessageWithEntity:ENTITY_CONVERSATION withPredicate:predicate];

ConversationManagedObject *conversationManagedObj = [conversations firstObject];

if(conversationManagedObj){

    conversationManagedObj.unread = !isRead;

    __block NSError *error = nil;

    if (![[NSThread currentThread] isMainThread]) {
        dispatch_async(dispatch_get_main_queue(), ^{

            if(![context save:&error]){
                NSLog(@"Cant Update Conversation! %@ %@", error, [error localizedDescription]);
            }else{
                NSLog(@"Conversation Updated!!!");
            }

        });

    }else{

        if(![context save:&error]){
            NSLog(@"Cant Update Conversation! %@ %@", error, [error localizedDescription]);
        }else{
            NSLog(@"Conversation Updated!!!");
        }

    }

}