是否可以将 2 添加cell.textlabel
到表格视图中。因为我想尝试显示 3 条不同的线。这是我做的代码:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
cell.textLabel.font = [UIFont systemFontOfSize:14]; //Change this value to adjust size
cell.textLabel.numberOfLines = 2;
cell.textLabel.text = [NSString stringWithFormat:@"%@ %@","Walk to and board at ",[boardDescArray objectAtIndex:indexPath.row]];
cell.textLabel.text = [NSString stringWithFormat:@"%@ %@","Alight Destination = ",[alDescArray objectAtIndex:indexPath.row]];
return cell;
}
但是当我放两个cell.textLabel.text
时它出错了bad access
。我该怎么办?请帮忙