質問

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