标签:
选中tableView的indexPath.row这一行
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.isFromChatView)
self.chatViewController.phraseString = [self.phraseArray objectAtIndex:indexPath.row];
//else
//self.newSMSViewController.messageString = [self.phraseArray objectAtIndex:indexPath.row];
//去掉选中的背景,恢复原来的样子
[tableView deselectRowAtIndexPath:indexPath animated:YES];
[self dismissModalViewControllerAnimated:YES];
}
前提是选中一行,做如下操作:
去掉[tableView deselectRowAtIndexPath:indexPath animated:YES],效果如下:
加上 [tableView deselectRowAtIndexPath:indexPath animated:YES],效果如下:
IOS TableView的Delegate Methods-tableView didSelectRowAtIndexPath
标签:
原文地址:http://www.cnblogs.com/yuyu-2012/p/4809689.html