I have the following model, as you can see in the image.
alt text http://img521.imageshack.us/img521/9741/schermata20100224a12251.png
My application requires updating each instance of B, so for each viewWillAppearI need to delete all B in the model. When B is deleted, the cascade deletion rule in relation to C will delete all C, and then the cascade to all D. A and E are constants.
I have a DeleteRule for each object as follows:
A: b - Cascade
B: c - Cascade, a - Nullify
C: b - Nullify, d - Cascade
D: c - Nullify, e - Nullify
E: d - Cascade
or
A -(cascade)->> B -(cascade)-> C -(cascade)->> D -(nullify)-> E
A <-(nullify)- B <-(nullify)- C <-(nullify)- D <-(nullify) E
B, C, D. fetchRequest B A, -deleteObject: B ObjectContext. EXC_BAD_ACCESS [managedObjectContext save: & ].
- , ? DeleteRule ? B, C, D?
:
:
#0 0x01d843ae in ___forwarding___
#1 0x01d606c2 in __forwarding_prep_0___
#2 0x01c618b6 in -[NSFetchedResultsController(PrivateMethods) _managedObjectContextDidChange:]
#3 0x0003263a in _nsnote_callback
#4 0x01d4f005 in _CFXNotificationPostNotification
#5 0x0002fef0 in -[NSNotificationCenter postNotificationName:object:userInfo:]
#6 0x01bc217d in -[NSManagedObjectContext(_NSInternalNotificationHandling) _postObjectsDidChangeNotificationWithUserInfo:]
#7 0x01c21763 in -[NSManagedObjectContext(_NSInternalChangeProcessing) _createAndPostChangeNotification:withDeletions:withUpdates:withRefreshes:]
#8 0x01ba65ea in -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:]
#9 0x01bdc728 in -[NSManagedObjectContext save:]
, NSZombieEnabled MallocStackLogging YES:
2010-02-24 15:41:39.803 Foo[2591:207] deleting object: FUM5
2010-02-24 15:41:40.515 Foo[2591:207] *** -[viewController controllerWillChangeContent:]: message sent to deallocated instance 0x7e54510
2: SOURCE ADDED
, . . README. , .