我希望在委托将信息传回时设置所选表格视图单元格的文本颜色。
这就是我所拥有的:
-(void)reSelectTableRow:(NSUInteger)index{
if(index < albumTracksArrayForTVC.count){
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:index inSection:0];
[self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:
UITableViewScrollPositionNone];
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
cell.textLabel.highlightedTextColor = [UIColor greenColor];
cell.textLabel.textColor = [UIColor redColor];
}
NSLog(@"Delegate reSelectTableRow was called");
[self.tableView reloadData];
}
但是,我的尝试(cell.textLabel.highlightedTextColor = [UIColor greenColor];
或cell.textLabel.textColor = [UIColor redColor];
)似乎都无效。
有什么想法吗?
以下是我最初在cellForRowAtIndexPath
cell.textLabel.highlightedTextColor = [UIColor brownColor];
中设置突出显示的文字的方式。