//此方法在表視圖控制器.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; } }