0
得到的代碼,但detailText僅在第一「列」表示的情況下,0Detailtext僅在第一個標籤表示
代碼是下:的cellForRowAtIndexPath
if (indexPath.row == 0) {
cell.detailTextLabel.text = @"A";
}
}
else if (indexPath.row == 1){
cell.detailTextLabel.text = @"B";
}
else if (indexPath.row == 2){
cell.detailTextLabel.text = @"C";
}
else if (indexPath.row == 3){
cell.detailTextLabel.text = @"D";
}
'characterAtIndex:'返回一個'unichar',而不是'NSString',所以不起作用。在這種情況下,你會使用'substringWithRange:'。 – omz 2011-12-18 20:42:03
@omz好的,我已經更新了我的答案。 – 2011-12-18 20:49:56