【发布时间】:2016-10-12 10:39:49
【问题描述】:
在 ui tableview 单元格中, 语句 if (cell == nil) 未被调用。
因为当我在 if 语句之外初始化单元格时,talbe 会在错误的行中有一些错误的标签。
如何初始化我的单元格?
@"tttestttt" NS LOG 并不是所有时间都在创建表时。
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *MyIdentifier = @"GroupsCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil) {
NSLog(@"tttesttttt");
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier];
}
}
【问题讨论】:
标签: ios tableviewcell