didSelectRowAtIndexPath 跳转传值问题

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    detailViewController *detaViewController = [[detailViewController alloc] init];
    [self.navigationController pushViewController:detaViewController animated:YES];
    
//    NSDictionary *president = self.presidents[indexPath.row];
//    NSString *urlString = president[@"url"];
//    NSLog(@"%@",urlString);
    
}

本类是根视图 detailViewController是跳转视图 根视图中有个plist文件对应的键值时name跟url 现在想实现点击表视图中的cell实现跳转并显示url的内容 跳转我已经实现了 哪要怎么传值呢? 新手望指教!

阅读 4.1k
1 个回答
  1. detailViewController *detaViewController = [[detailViewController alloc] init];

2.

NSDictionary *president = self.presidents[indexPath.row];
NSString *urlString = president[@"url"];
NSLog(@"%@",urlString);
detaViewController.president = president;
detaViewController.urlStirng = urlStirng;
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进