Update 18/3 # 2. I started counting beginUpdates and EndUpdates to make sure they are even. Right before this exception, they go out of sync. Not sure why.
UPDATE 18/3: I think I found the problem , but I'm not sure if I know how to fix it. After experimenting for several hours, I found that I can only crash the application when more than one item in the main view of the svc table was selected in this session. When another item is selected in the main table view, the detail table view gets a new set of objects, and refreshtables is called EVEN if it is halfway through the update / move / delete / insert cycle. Hence the problem; I think he has instructions for updating the old story object, even if the new story object was installed on the detailviewcontroller.
How can I fully process animation updates / coredata / tableview before a new plot is set in the detail view? I save changes to managedObjectContext when setEditting == NO. I assume that I need to create a custom setStory setter that processes all updates in a UITableView / CoreData before accepting a new object?
This code is called in the main controller of the svc table in the didSelectRowAtIndexPath file:
[detailViewController setStory:storySet];
I have intermittent errors when I try to delete a line in which the action will not be animated, and the application essentially freezes with the following error (the line is deleted from the CoreData set, though). This happens if I select multiple rows from the main table controller in svc in one session.
After some googling, I thought it might be a problem with the controller (void): (NSFetchedResultsController *) controller didChangeObject: (id) , which is called after the update to revive the changes made by the user,
How can I fix these intermittent errors?
- 16/3 I tried to really simplify my code. I deleted all the calls in the Context of the managed object and placed them in setEditing, deleted the unnecessary [self.tableview reloadData] and [self.tableview setneedsdisplay] and completely deprived the “reordering” bool (it is still in the code, but it always set to NO, so it doesn’t matter). The UITableView is more stable than ever, but I still manage to get intermittent errors when deleting (and sometimes when adding) - it seems like it takes some time for the crash, but it still will. **
- 15/3: I think this is due to the fact that CoreData / UITableView is out of sync - CoreData thinks it has less or more than UITableView
- No problem with a set of CoreData, it's just the animation / user interface side (things are deleted)
- It is intermittent, only with some deletions
- After some help from railparade, I implemented NSFetchedResultsChangeMove in the didChangeObject file: the move error was fixed, but not the delete error.
Can anyone see anything that I missed, or that I can check? I am glad to provide additional information if this helps to solve the problem.
Sorry for the indecent amount of code posted here.
Error:
CoreData: Error: A serious application error. Ruled out. from the NSFetchedResultsController delegate during a call to -controllerDidChangeContent :. try inserting line 3 into section 0, but there are only 3 lines in section 0 after updating with userInfo (Zero)
// // MakeSentenceTableViewController.h // StoryBot // // Created by Glen Storey on 25/10/10. // Copyright 2010 Glen Storey. All rights reserved. // #import <UIKit/UIKit.h>