首页 > 其他 > 详细

UITableViewCell点击不能push解决方法

时间:2017-05-15 10:40:15      阅读:406      评论:0      收藏:0      [点我收藏+]

一般情况下不能push是因为当前控制器没有导航控制器,造成不能push的情况.

解决方法如下:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    NSLog(@"点击left-%d",(int)indexPath.row);
    NSLog(@"%@",self.navigationController);
    TempViewController *tempVc = [[TempViewController alloc]init];
    UINavigationController *navVC = [UIApplication sharedApplication].keyWindow.rootViewController.childViewControllers[0].navigationController;
    [navVC pushViewController:tempVc animated:YES];
}

还有什么好的解决方式,请大神告知哟..嘻嘻~~~

UITableViewCell点击不能push解决方法

原文:http://www.cnblogs.com/pengsi/p/6855309.html

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