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

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top