1. 首先,在tableViewController中设置好 代理和数据源方法:

    @interface FirstTableViewController ()<UITableViewDataSource,UITableViewDelegate>

  2.  实现一系列的数据源方法:让其显示数据 例如 简单显示 几行 :
     #pragma mark 数据源方法 
    
     /**
    
      *  一共有多少组数据
    
      */
    
     -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
    
     {
    
         return  ;
    
     }
    
     /**
    
      *  第section组有多少行
    
      */
    
     -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    
     {
    
         if (section == ) {
    
             return  ;
    
         }else{
    
             return  ;
    
         }
    
     }
    
      -(UITableViewCell *)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    
     {
    
         UITableViewCell *cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];  
    
         cell.textLabel.text = @"";
    
           return cell ;
    
     }
  3.  添加此方法实现跳转。
     -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    
     {
    
         SecondTableViewController *SVC = [[SecondTableViewController alloc]init];
    
         [self.navigationController pushViewController:SVC animated:YES];
    
     }

    注:点击cell 后先创建个UIview 之后再用navigationController 推送出来

    这样就可以成功通过点击cell 创建新页面了 实现跳转了。

    ---------摘自百度经验,有删改,感谢原著

最新文章

  1. Re 模块
  2. 你真的了解UIButton、UILabel 吗?
  3. Linux gnome
  4. Kalman滤波器原理和实现
  5. UVa 3487 &amp; 蜜汁建图
  6. 协同过滤 CF &amp; ALS 及在Spark上的实现
  7. 转】MyEclipse使用总结——设置MyEclipse开发项目时使用的JDK
  8. String 内在分配解析
  9. echars3.0 柱状图大小设置
  10. swing容器继承重绘问题解决
  11. Tribles(概率)
  12. svn出现“Previous operation has not finished; run &#39;cleanup&#39; if it was interrupted”,解决方法
  13. UVA 1610 Party Games
  14. esb和eai的区别
  15. REST(Representational state transfer)的四个级别以及HATEOAS介绍
  16. 高通平台如何使用QPST抓DUMP
  17. fastcgi协议分析与实例
  18. CF1110D Jongmah(DP)
  19. Tensorflow图像处理
  20. R语言文件相关的操作

热门文章

  1. mongodb从入门到精通
  2. 静态html返回
  3. fiddler模拟timeout超时场景
  4. JMeter一次简单的接口测试(转载)
  5. vps vultr centos7 搭建 伟皮恩
  6. MyLineNumberReader
  7. 2018年全国多校算法寒假训练营练习比赛(第四场)B:道路建设
  8. 33 【kebernetes】一个错误的解决方案
  9. 【go】http实验
  10. f5会话保持