[request2 setEntity:entity];
NSPredicate * predicate2 = [ NSPredicate predicateWithFormat:@"logoFrameNum == %@",[NSNumber numberWithInt:7]];
[request2 setPredicate:predicate2];
NSManagedObject * collectionList2 = [[ managedObjectContext executeFetchRequest:request2 error:&error2] objectAtIndex:0];
NSLog(@"context :%@", deleteContext1);
[managedObjectContext deleteObject:collectionList2];
BOOL yesorno = [collectionList2 isDeleted];
NSLog(@"yesorno : %i", yesorno);
NSError * error10;
NSLog(@"[managedObjectContext ] : %@", deleteContext1);
[collectionList2 release];
if (![managedObjectContext save:&error10]) {
// Update to handle the error appropriately.
NSLog(@"Unresolved error %@, %@", error10, [error userInfo]);
exit(-1); // Fail
}
上面有更多的來源。更改變量或從coredata獲取數據很好地執行與我在那裏有相同的NSManagedObjectContex。然而,用這種語境刪除讓我發瘋。它崩潰,沒有任何錯誤信息只是在CoreData刪除保存錯誤
if (![managedObjectContext save:&error10]) {
我試圖得到一個新的上下文等等和........很多..
'deleteContext1'從哪裏來? – Eimantas