Still can't delete CoreData object
Still can't delete CoreData object
- Subject: Still can't delete CoreData object
- From: Rick Mann <email@hidden>
- Date: Tue, 25 Jun 2013 15:30:59 -0700
I have a situation in which I can't delete one of my core data objects from a UITableView. The list is built using NSFetchedResultsController, and I delete the objects after the user swipes to delete with
Job* obj = [self.resultsController objectAtIndexPath: inIndexPath];
[obj.managedObjectContext deleteObject: obj];
I then save the MOC.
My -controller:didChangeObject:atIndexPath:forChangeType:newIndexPath: delegate method gets called with NSFetchedResultsChangeDelete, and I call
[self.tableView deleteRowsAtIndexPaths: @[ inIndexPath ] withRowAnimation: UITableViewRowAnimationAutomatic];
But then, as part of the same MOC -save: call, it gets a NSFetchedResultsChangeInsert. Interestingly, the address of the object inserted is the same as the address of the object that was just deleted, as is its x-coredata URI, but all of its properties have default values.
If I then try to delete the object again, it's data is <fault>, and the MOC -save method returns false, but no NSError is returned.
Any ideas?
--
Rick
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden