0

I am trying to push a table view controller that I have on my storyboard from a view controller that I don't have in my storyboard. I get these errors when i get to initializing the first table view cell. I've made sure the table view controller and the table view cell are set to the correct class types that I've defined and I've set the correct identifier for the cell.

Error Occurs at Line:

CustomTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ListPrototypeCell" forIndexPath:indexPath];

Error:

*** Assertion failure in -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:], /SourceCache/UIKit_Sim/UIKit-2935.137/UITableView.m:5439

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier ListPrototypeCell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'

What am I missing?

P.S that other link does not have the answer, I need to initialize multiple cells of this type, I need the index for different data.

mithunm93
  • 551
  • 5
  • 17
  • Please revise the title of your question which is misleading. – Mundi Jun 17 '14 at 20:55
  • It has nothing to do with navigation, your table&datasource are not configured correctly. – A-Live Jun 17 '14 at 21:01
  • possible duplicate of [Assertion failure in dequeueReusableCellWithIdentifier:forIndexPath:](http://stackoverflow.com/questions/12737860/assertion-failure-in-dequeuereusablecellwithidentifierforindexpath) – Paulw11 Jun 17 '14 at 21:19
  • How are you initializing the tableview controller? What prototype cells do you have in Storyboard and what are their reusable ids? – Alex Reynolds Jun 17 '14 at 23:11
  • Use `dequeueReusableCellWithIdentifier:` and it will be OK – Tony Jun 18 '14 at 01:51

1 Answers1

0

Why not just put all the view controllers in one storyboard?

If you're trying to push from a UITableViewCell, you could use a segue method.

First: Control-Drag from your TableViewController to your ViewController to link them with a push segue. Name the segue. E.G. "segueName"

Create a prepareForSegue method like so:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender


{


if ([segue.identifier isEqualToString:@"segueName"])
{

// do whatever you want here

}

and then under your didSelectRowAtIndexPath:, run the segue using this:

[self performSegueWithIdentifier:@"segueName" sender:nil];

Perhaps you could elaborate a bit more, if this does not work.

Machina
  • 252
  • 2
  • 13