0

Thanks for the help in advance-

I have a UITableView with a custom cell. If I insert a break point, and log the values for the cell it is correct, but when I execute the code the table view is always blank (but does have the right number of cells)

    Cell *cell = (Cell *)[tableView dequeueReusableCellWithIdentifier:[Cell reuseIdentifier]];

if (cell == nil)
{
    cell = [Cell cell];
}

StoreData *currentStore = [_storeArray objectAtIndex:indexPath.row];
cell.phoneNumber.text = currentStore.phoneStr;
cell.address.text = currentStore.addressStr;

return cell;

Thanks for the help

Nathan
  • 1,609
  • 4
  • 25
  • 42
  • put a breakpoint at "StoreData *currentStore = [_storeArray objectAtIndex:indexPath.row];" and check if cell is nil.. – dRAGONAIR Oct 26 '13 at 17:20
  • > The Cell is not nil ... – Nathan Oct 26 '13 at 17:25
  • in that case its hard to debug using only this piece of code..sorry but other things that you can check is 1. if your tableView is registered to cell of type Cell 2. you can check if "currentStore" is not nil(or has data) 3. give some bkground color to "cell.phoneNumber" and "cell.address" to see if they are hav been added in the view/ or put a breakpoint after the above if statement u mentioned as print "cell.contentView.subviews".. – dRAGONAIR Oct 26 '13 at 17:41

1 Answers1

1

Are you certain you registered the custom cell using its class or nib? Also, you are asking to deque based on asking the cell for its identifier - but you must ensure you registered for every class you are trying to deque. Finally, also ensure you set the identifier property inside the storyboard or nib file as well.

Bladebunny
  • 1,251
  • 9
  • 12