Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

What does unsupported configuration - prototype table cells must have reuse identifiers mean?

Got this error when trying to run iOS simulator for the Ribbit App after the stage "A storyboard with a tab bar controller"

It means that the table cells added using the Storyboard do not have a reuse identifier set. You need a resuse identifier in order to use dequeueReusableCellWithIdentifier: method when parsing your table data.

You can set the identifier while in Storyboard, after clicking the cell in question, on the right side tab, under the property inspector ( if not wrong).

In iOS, table view cells must have a reuse identifier to help the controller create new reusable cells instead of unique ones.

Your problem may be in your prototype cell in your storyboard. Click on the white space under Prototype Cells > Utilities Pane > Attribute inspector > and go add a reusable ID in the identifier field.

Now in your code, when you call methods like : [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; Replace the CellIdentifier for the Id you chose earlier: [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; or static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

1 Answer

as Robert Bojor said, you must said up it's reuse identifier, the way you do this is where you set up the tableViewCell (or collectionViewCell) you must do,

UITableViewCell *cell = [tableView dequeueReusableCellWithReuseIdentifier:@"Cell" forIndexPath:indexPath];

and in the viewDidLoad you must set up the other side of this by doing,

[self.tableView registerClass:[UITableViewCell class] forCellWithReuseIdentifier:@"Cell"];

hope this helps, Kai