Reputation: 1491
I have a storyboard in a project I am working on, but recently I have noticed that I am having issues. Out of nowhere, my code is now telling me I need to register a class for a cell identifier
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier rootCell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'
(I have the cell prototype in the storyboard, so I don't believe I need to.) if I perform
[tableView registerClass:<my class> forCellReuseIdentifier:<identifer>];
it will get beyond that, but then it hangs up when I
[self performSegueWithIdentifier:<my ID> sender:self];
and tells me that it cannot find the segue. I was able to confirm the segue is setup with the proper Identifier in the storyboard.
Does anyone know what the problem could be?
I did a rename on the storyboard a while back, but I updated info.plist and I'm pretty sure it still worked after that.
If I re-create the storyboard in another project, it works fine, but if I re-create the storyboard in this project, it fails.
EDIT: I do have the class set correctly in IB also this is a manual segue.
EDIT: Added exact error wording.
Upvotes: 0
Views: 285
Reputation: 14247
If you delete the storyboard from your iPhone/iPad/Simulator or wherever you're debugging it, and then clean in Xcode, then build & run, do you see different results? The reason I ask is that each time you build in Xcode, you get a union of everything your project has ever contained. So if you renamed the storyboard, and haven't done a full clean, you likely have both storyboards in your built product.
Upvotes: 0
Reputation: 128
I just had this happen.
Had to add [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"WhateverCellID"];
in my viewDidLoad
I was using a regular viewController, realized my mistake, and switched to a tableViewController and started getting the same error.
Alternatively use 'UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];` Without the indexPath option this is a different call, which doesn't require registration and may suit your needs.
Upvotes: 1