Apple's
CoreDataBooks example crashes on the correct sequence of editing the sample entries, and the same issue effects my app. It occurs when a section with a single row has it's row's entity edited, therefore moving it into a new section with a single row. To reproduce follow these steps.
- Open a new instance of CoreDataBooks example
- Edit Richard Dawkins book, "The Selfish Gene" and change the author to Ben. Save it. If you return to the main view you'll notice that the book is under a new section named Ben.
- Edit this book again, and change the author to Doug. Save it. You'll get the following exception:
Code:
2009-10-01 15:14:29.050 CoreDataBooks[10898:20b] *** Assertion failure in -[UITableView_endCellAnimationsWithContext:], /SourceCache/UIKit/UIKit-963.10/UITableView.m:729 2009-10-01 15:14:29.051 CoreDataBooks[10898:20b] Serious application error. Exception was caught during Core Data change processing: Invalid update: invalid number of rows in section 1. The number of rows contained in an existing section after the update (2) must be equal to the number of rows contained in that section before the update (2), plus or minus the number of rows inserted or deleted from that section (0 inserted, 0 deleted). with userInfo (null)
Any suggestions on how to fix this would be appreciated. I've already filed a bug report with apple but haven't heard anything in a few days.