invalid nib registered for identifier (CELLNAME) - nib must contain exactly one top level object which must be a UITableViewCell instance

ios, objective-c, uitableview, xcode

Solution

I had the same problem as above but I wasn't using storyboards and the problem just appeared out of the blue.

I found that the solution was in the tableview cell file. I had added a uibutton, but it had been added outside the bounds of the cell by mistake. This meant it was almost like an extra view in the uiview.

Once I found it and deleted this extra view the problem disappeared immediately.

If you have having this error, check the uitableviewcell for extra views and objects added by mistake

Problem

Sorry for the long title, but I wanted it to be clearly seen from a google search. Also, this differs from many of the other similar questions on here as its not specifying a 'null' identifier but one that actually exists. Essentially the problem occurs when your trying to navigate using one of the cells in a table view controller to segue to another view (Whatever that view may be). Most people would run into this problem after gunning through the apple tutorial on the 'To-Do List' and expecting the cells to operate in the same motion regardless of their purpose. This problem is probably simplistic to most but for a beginner, its quite hard, it took me around 3 hours. Basically the error is: ``` invalid nib registered for identifier (prototypeCell) - nib must contain exactly one top level object which must be a UITableViewCell instance ``` Where 'prototypeCell' would be whatever your cell is called. This is an exception that occurs immediately as the app is launched.

Original source