zoukankan      html  css  js  c++  java
  • UITableViewCell点击不能push解决方法

    一般情况下不能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];
    }

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

  • 相关阅读:
    Python之内置函数再总结
    内置函数
    函数递归
    字符编码之文件处理
    文件处理
    python1数据链接总结
    知识点练习day9
    第一周作业
    python1
    网络基础预习
  • 原文地址:https://www.cnblogs.com/pengsi/p/6855309.html
Copyright © 2011-2022 走看看