【发布时间】:2011-07-30 17:35:31
【问题描述】:
在显示表格视图并选择一行后,我想将所有未选择的行表格文本标签颜色更改为蓝色。当前在 case 语句中我可以更改当前行选择的文本标签,但是在这种情况下,我不知道如何访问其他行的文本标签。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
switch (indexPath.row) {
case 0:
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.textLabel.textColor = [UIColor yellowColor];
//******* NEED TO CHANGE ALL OTHER ROWS TEXT LABEL TO BLUE
break;
case 1:
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.textLabel.textColor = [UIColor yellowColor];
//******* NEED TO CHANGE ALL OTHER ROWS TEXT LABEL TO BLUE
break;
default:
break;
}
}
【问题讨论】:
标签: iphone objective-c xcode xcode4