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?