I have two controllers list and create entity, when i create first entity and dismiss create entity controller to return to list, list controller tries to return his orientation and tableView asks for number of sections and number of entities via dataSource (default UIKit behavior). Fetched results controllers answers that it has one section and one row. And only after this it calls delegate about beginUpdates, insertSection, insertRow, endUpdates. As a result a have crash. Because it already answered tableView about number of it's sections.
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of sections. The number of sections contained in the table view after the update (1) must be equal to the number of sections contained in the table view before the update (1), plus or minus the number of sections inserted or deleted (1 inserted, 0 deleted).'
It seems like trouble is here. http://prntscr.com/dpdt8j It sends notifications async. And send "contentWillUpdate" after that it already has an object.
I have two controllers list and create entity, when i create first entity and dismiss create entity controller to return to list, list controller tries to return his orientation and tableView asks for number of sections and number of entities via dataSource (default UIKit behavior). Fetched results controllers answers that it has one section and one row. And only after this it calls delegate about beginUpdates, insertSection, insertRow, endUpdates. As a result a have crash. Because it already answered tableView about number of it's sections. Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of sections. The number of sections contained in the table view after the update (1) must be equal to the number of sections contained in the table view before the update (1), plus or minus the number of sections inserted or deleted (1 inserted, 0 deleted).'