Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect a prototype cell in a storyboard?

I've created a tableview in the storyboard, and a custom prototype cell. I've set the cell identifier in the storyboard, and am trying to dequeue it and am getting:

unable to dequeue a cell with identifier TTEntry - must register a nib or a class for the identifier or connect a prototype cell in a storyboard

I can't see anything else in the storyboard TableCell properties to link it with. I just don't know what the message is getting at.

Can someone point me in the right direction?

Thanks!

Screwtape.

like image 638
Screwtape Avatar asked Nov 21 '14 16:11

Screwtape


2 Answers

From Storyboard:

  1. In Attribute Inspector set Reuse Identifier
  2. Add your CustomCell class in your storyboard like mentioned by Jignesh Agola

From code (like lemon lime pomelo posted) :

[self.tableView registerClass:<Your UITableViewCell subclass> forCellReuseIdentifier:<Your identifier>]
like image 138
Tamara Avatar answered Oct 04 '22 21:10

Tamara


Add your CustomCell class in your storyboard

enter image description here

like image 20
Jignesh Agola Avatar answered Oct 04 '22 21:10

Jignesh Agola