NSInternalInconsistencyException’, reason: ‘attempt to insert row 0 into section 0, but there are only 0 rows in section 0 after the update’

I ran into this error when I forgot to set the datasource outlet properly.

If you see this error, check that you have explicitly set your TableView delegate and datasource :

  • go to your interface builder and look at the view with the ‘Table View’

  • cmd + right click drag ( you should see a blue line ) from the ‘Table View’ icon to the title icon for the file, this has a yellow icon next to it in xcode 6.

  • release your mouse , you should see delegate and datasource options.

  • select ‘datasource’

your table should now be correctly wired.

Leave a Comment