views:

55

answers:

1

I have a table view managed by a NSFetchedResultsController. I am using the Apple-provided boilerplate code in my TableViewController. My predicate retrieves objects based on their name. Everything seems to work fine when it comes to adding/deleting objects using the 'edit' button. If I programmatically change an object's name, things also work fine unless the name change results in the object moving up the table, in which case I get this error:

Serious application error. An exception was caught from the delegate of NSFetchedResultsController during a call to -controllerDidChangeContent:. * -[NSMutableArray objectAtIndex:]: index 1 beyond bounds [0 .. 0] with userInfo (null)

Say I have three objects named A, C and D. If I rename D to B then the app crashes. If I rename C to B, everything is cool.

What's going on here?

A: 

Use of Deusty's SafeFetchedResultsController subclass of NSFetchedResultsController can help deal with tricky row update and move operations that trip up Apple's class, causing these exceptions.

Alex Reynolds
This doesn't seem to have helped :( but thanks for the suggestion. I have decided to simply reload the tableView whenever content changes (I never have more than 7 or 8 rows anyway...)
Garry