Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Are you running <code>registerClass:forCellReuseIdentifier:</code> or <code>registerNib:forCellReuseIdentifier:</code> after your tableView has been created? This is what tells your table view to use your custom class/nib when creating a cell. You would likely do this in the <code>viewDidLoad</code> method of your view controller.</p> <p>As of iOS 6 dequeueReusableCellWithIdentifier: always returns a cell if you have registered a class using one of the <code>register???:forCellReuseIdentifier:</code> methods. Previously it would return nil if a free cell was not available. You don't need to test <code>cell == nil</code> if you are building for iOS 6.</p> <p>EDIT: You mention this is a TableViewController. I assume this means your view controller is a subclass of UITableViewController. If this is the case there is already an instance if UITableView available via the <code>tableView</code> property and no need to create one in your viewDidLoad method. Instead I would change your code to look like this:</p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; self.tableView.delegate = self; self.tableView.dataSource = self; self.tableView.allowsMultipleSelection = NO; [[self tableView] registerClass:[CCTableViewCell class] forCellReuseIdentifier:CELL_ID]; [[self tableView] reloadData]; } </code></pre> <p>In fact, you might not have to set the delegate and dataSource properties if you are using a UITableViewController (I'm not sure if this is already done for you). Have you tried adding an NSLog in <code>tableView:cellForRowAtIndexPath:</code> to be sure it's being called?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload