Hi all,
I have been deleting objects with code similar to this.

        NSManagedObjectContext *context = [[self fetchedResultsController] 
managedObjectContext];
        
        [context deleteObject:videoEntity];
        [managedObjectContext processPendingChanges];
        
        //commit the delete
        NSError *saveError = nil;
        if (![context save:&saveError]) 
        {
                NSLog(@"CoreData Failure");
        }else {
                //all good
                NSLog(@"CoreData delete success");
                NSLog(@"\n\nNumber of objects in store after delete: %d\n\n", 
[[self.fetchedResultsController fetchedObjects] count]);
        }

This works fine (as far as deleting the entry) however it crashes with a crash 
like that shown below:  I also saw a recommendation to add this:

- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller
{
        NSLog(@"controllerDidChangeContent");
} 

This seems to make no difference to the crash.

2010-08-31 06:52:40.811 ecaster.tv[2072:307] *** Terminating app due to 
uncaught exception 'NSObjectInaccessibleException', reason: 'CoreData could not 
fulfill a fault for '0x2951d0 
<x-coredata://38E6A994-7862-4CD3-BDDA-5F0EBB02E7FB/TVVideo/p70>''
*** Call stack at first throw:
(
        0   CoreFoundation                      0x313f4fd3 
__exceptionPreprocess + 114
        1   libobjc.A.dylib                     0x3302f8a5 objc_exception_throw 
+ 24
        2   CoreData                            0x330f4da9 
_PFFaultHandlerLookupRow + 1244
        3   CoreData                            0x330f48c5 -[NSFaultHandler 
fulfillFault:withContext:] + 20
        4   CoreData                            0x330f289d 
_PF_FulfillDeferredFault + 360
        5   CoreData                            0x330f62af 
_sharedIMPL_pvfk_core + 58
        6   CoreData                            0x330f64cb _pvfk_11 + 10
        7   ecaster.tv                          0x00073d31 
-[ECDeferedUploadController deleteButtonPressed:] + 384
        8   CoreFoundation                      0x3137f7ad -[NSObject(NSObject) 
performSelector:withObject:withObject:] + 24
        9   UIKit                               0x316c5829 -[UIApplication 
sendAction:to:from:forEvent:] + 84
        10  UIKit                               0x316c57c9 -[UIApplication 
sendAction:toTarget:fromSender:forEvent:] + 32
        11  UIKit                               0x316c579b -[UIControl 
sendAction:to:forEvent:] + 38
        12  UIKit                               0x316c54ed 
-[UIControl(Internal) _sendActionsForEvents:withEvent:] + 356
        13  UIKit                               0x316c5b3b -[UIControl 
touchesEnded:withEvent:] + 342
        14  UIKit                               0x316c44ed -[UIWindow 
_sendTouchesForEvent:] + 368
        15  UIKit                               0x316c3e67 -[UIWindow 
sendEvent:] + 262
        16  UIKit                               0x316bfb5b -[UIApplication 
sendEvent:] + 298
        17  UIKit                               0x316bf507 
_UIApplicationHandleEvent + 5022
        18  GraphicsServices                    0x329f4147 PurpleEventCallback 
+ 666
        19  CoreFoundation                      0x313caaab 
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
        20  CoreFoundation                      0x313cc84f __CFRunLoopDoSource1 
+ 166
        21  CoreFoundation                      0x313cd62d __CFRunLoopRun + 520
        22  CoreFoundation                      0x313768eb CFRunLoopRunSpecific 
+ 230
        23  CoreFoundation                      0x313767f3 CFRunLoopRunInMode + 
58
        24  GraphicsServices                    0x329f36ef GSEventRunModal + 114
        25  GraphicsServices                    0x329f379b GSEventRun + 62
        26  UIKit                               0x316692a7 -[UIApplication 
_run] + 402
        27  UIKit                               0x31667e17 UIApplicationMain + 
670
        28  ecaster.tv                          0x00002317 main + 70
        29  ecaster.tv                          0x000022cc start + 40
)
terminate called after throwing an instance of '_NSCoreDataException'



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to