zoukankan      html  css  js  c++  java
  • storyboard传值方式

    通过segue传值 在storyboard设置segue的Identifier
     
    segue是连接两个视图控制器交互的线
    sender是触发这个方法执行的对象,比如是单击tableView上的cell跳到下一界面  那么这个cell就是sender
    //此方法在表视图控制器.m文件中最下面
    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller.
       //将当前位置的jid赋值给要跳转的视图控制器的的jid属性 if ([segue.identifier isEqualToString:@"push"]) { UITableViewCell *cell = sender; ChatTableViewController *chatVC = segue.destinationViewController;//跳转的下一界面 NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];//获取位置信息 XMPPJID *jid = self.dataArray[indexPath.row];//根据位置信息找到数据 chatVC.jid = jid; } }

      

  • 相关阅读:
    CTreeCtrl::HitTest
    GetLastError()函数返回值及含义
    最大轮廓和投影 转
    一些Python黑客脚本
    win10系统架构调用
    rootkit基础
    面向对象编程
    机器学习概述
    XXE攻击
    浏览器安全
  • 原文地址:https://www.cnblogs.com/dabaomo/p/5267263.html
Copyright © 2011-2022 走看看