我的cell.textLabel.text
有時會返回空字符串。有沒有辦法可以跳過這個單元格,並在我的最後一個非空cell.textLabel.text
後面放上我的下一個文本標籤?所以不應該有空標籤。如何跳過UITableViewCells中的空標籤
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *MyIdentifier = @"MyIdentifier";
UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:MyIdentifier];
}
ResultModel *resultModel = [self.array objectAtIndex:indexPath.row];
cell.textLabel.text = resultModel.resultString;
return cell;
}