如何通过编码使用selectRowAtIndexPath来回调didSelectRowAtIndexPath

时间:2013-10-29 04:06:07

标签: ios

我用

[tableView selectRowAtIndexPath:index animated:YES scrollPosition:UITableViewScrollPositionMiddle];

将表格滚动到单元格,我想更改单元格中的文本颜色。 但是,

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)
-(NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath
-(void)tableView:(UITableView *)tableView didHighlightRowAtIndexPath:(NSIndexPath *)indexPath

所有人都无法回调。

我该怎么办?

2 个答案:

答案 0 :(得分:1)

自己打电话......

[tableView.delegate tableView:tableView didSelectRowAtIndexPath:index];

答案 1 :(得分:0)

我使用了不推荐使用的属性:

cell.selectedTextColor

不太好,但有效。