通过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;
}
}

  

最新文章

  1. javascript中的 类初始化,遍历for in 以及with的用法
  2. poj 3253:Fence Repair(堆排序应用)
  3. onclick事件分析
  4. PHP流程控制语句下
  5. Eclipse的java代码出错:The import org.apache cannot be resolved
  6. Linux FTP安装与简单配置
  7. Java 8 Stream
  8. Scrum Meeting 5
  9. 廖雪峰Java1-3流程控制-9break、continue
  10. 【代码笔记】iOS-UILabel根据内容自动调整高度
  11. OutputFormat输出过程的学习
  12. Axure RP 快速原型设计工具
  13. python 调用 shell 命令
  14. Oracle免客户端InstantClient安装使用
  15. 做php网站后台开发,在Linux系统上进行更好吗?【转载】
  16. archlinux安装tftp
  17. .net 非阻塞事件获取返回异步回调结果
  18. filezilla绑定编辑器
  19. [Tools] Support VS Code Navigation and Autocomplete Based on Webpack Aliases with jsconfig.json
  20. HTML5 - 新增的元素,删除的元素

热门文章

  1. WPF Tookit Chart
  2. [转]【无私分享:ASP.NET CORE 项目实战(第九章)】创建区域Areas,添加TagHelper
  3. 在线倍增法求LCA专题
  4. Java 线程同步
  5. 第三章SQL编程
  6. 3D游戏常用技巧Normal Mapping (法线贴图)原理解析——基础篇
  7. Intellij IDEA 快捷键整理(TonyCody)
  8. 选中多个<ul>中的第一个<li>方法
  9. visual studio 2015中的webapi生成helpPage,页面不显示方法说明问题解决
  10. 关于Repository、Autofac、DbContext简单例子