zoukankan      html  css  js  c++  java
  • 代码实现窗口跳转

    UINavigationController类方法跳转窗口:

    - (void)showViewController:(UIViewController *)vc sender:(id)sender

    - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated;

    storyboard实现窗口跳转:

    UIViewController类的方法

    - (void)performSegueWithIdentifier:(NSString *)identifier sender:(id)sender

    在代码中实现- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender方法,可以进行数据传递,在storyboard中设置

    实例代码:

    [self performSegueWithIdentifier:@"ShowDetail" sender:self];

    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {

        if ([segue.identifier isEqualToString:@"ShowDetail"]) {

            DetailViewController   *detailViewController = segue.destinationViewController;

            NSInteger selectedIndex = [[self.tableView indexPathForSelectedRow] row];

            NSDictionary *dict = [self.listData objectAtIndex:selectedIndex];

            detailViewController.url = [dict objectForKey:@"url"];

            detailViewController.title = [dict objectForKey:@"name"];

            

        }

    }

  • 相关阅读:
    code1135 选择客栈
    code3289 花匠
    code1167 树网的核
    线段树
    二分图 and code1170 双栈排序
    code1001 舒适的路线
    svg的自述
    a链接bug
    去除a标签链接触摸时产生边框
    前端资源收藏
  • 原文地址:https://www.cnblogs.com/PJXWang/p/5509032.html
Copyright © 2011-2022 走看看