UI控件不显示带故事板的自定义uitableviewcell中的内容

时间:2015-01-16 03:02:59

标签: uitableview storyboard custom-controls reuseidentifier registerclass

我不明白为什么在使用IOS8和XCODE 6.1.1运行应用时,我的故事板中的标签不显示 enter image description here 我已将我的标签绑定到自定义UiTableviewCell,我可以设置文本,但我的标签没有出现在tableView dequeueReusableCellWithIdentifier:CellIdentifier];

返回的单元格的内容视图的子视图中

如果使用[self.tableView registerClass:[NewGameCell class] forCellReuseIdentifier:@"ListNewGameCell"]; 我无法使用故事板。

我读了所有其他问题但我找不到答案。 感谢

2 个答案:

答案 0 :(得分:1)

试试这个......

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    YourCustomCell *cell = (YourCustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
    return cell;
}

答案 1 :(得分:0)

好的,我太蠢了!

UILabel没有显示,因为我只为iPad添加它,我的模拟器在iPhone上。 谢谢你的帮助