首页 > 移动平台 > 详细

iOS设置UITableView中Cell被默认选中后怎么触发didselect事件

时间:2017-01-16 19:48:29      阅读:353      评论:0      收藏:0      [点我收藏+]

//默认选中某个cell

[self.searchResultTV selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:YES scrollPosition:UITableViewScrollPositionNone];

               

//实现该cell的didSelectRowAtIndexPath方法

NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];

               

if ([self.searchResultTV.delegate respondsToSelector:@selector(tableView:willSelectRowAtIndexPath:)]) {

                    [self.searchResultTV.delegate tableView:self.searchResultTV willSelectRowAtIndexPath:indexPath];

                }

               

[self.searchResultTV selectRowAtIndexPath:indexPath animated:YES scrollPosition: UITableViewScrollPositionNone];

               

if ([self.searchResultTV.delegate respondsToSelector:@selector(tableView:didSelectRowAtIndexPath:)]) {

                    [self.searchResultTV.delegate tableView:self.searchResultTV didSelectRowAtIndexPath:indexPath];

                }

 

iOS设置UITableView中Cell被默认选中后怎么触发didselect事件

原文:http://www.cnblogs.com/sunfuyou/p/6290680.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!