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];
    }

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

  • 相关阅读:
    校门外的树
    学生档案
    冒泡排序法
    寻找最大数序列
    初识结构体
    找零钱
    冒泡的应用
    关于数组的逆序重放
    关于质数
    字符串转换为日期格式
  • 原文地址:https://www.cnblogs.com/pengsi/p/6855309.html
Copyright © 2011-2022 走看看