【发布时间】:2010-12-23 00:48:34
【问题描述】:
我想在单元格被选中时更改它的 textLabel 和 detailTextLabel。 我尝试了以下方法,但没有发生任何变化:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
MyAppDelegate *appDelegate = (MyPhoneAppDelegate*)[[UIApplication sharedApplication] delegate];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.detailTextLabel.text = @"xxxxx";
cell.textLabel.text = @"zzzzz";
[tableView reloadData];
}
【问题讨论】:
标签: iphone uitableview didselectrowatindexpath