【发布时间】:2012-12-13 01:38:13
【问题描述】:
我制作了一个自定义UITableViewCell,其中包含标签和segmentcontrol 等元素但是当我尝试访问cellforrowatindexpath 中的元素时,这些元素没有分配任何内存。单元实例已分配内存。我检查了xib并连接了插座。
这是cellforrowatindexpath中的代码-
SegmentCell *cell;
[tableView registerNib:[UINib nibWithNibName:@"SegmentCell" bundle:nil] forCellReuseIdentifier:@"SegmentCell"];
[tableView registerClass:[SegmentCell class] forCellReuseIdentifier:@"SegmentCell"];
cell = (SegmentCell *)[tableView dequeueReusableCellWithIdentifier:@"SegmentCell" forIndexPath:indexPath];
cell.title.text=@"Hell*emphasized text*o";
return cell;
标题是在打印描述中显示为 nil 的标签
【问题讨论】:
标签: objective-c uitableview ios6 uilabel