zoukankan      html  css  js  c++  java
  • 视图传值-跳转

    //向下个视图传值

    #pragma mark - Navigation

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

    {

    //你连接的 identifier 的内容

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

    //        点击行内容

            NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];

            UITableViewCell* viewCell = [self.tableView cellForRowAtIndexPath:indexPath];

            NSString* str = [[viewCell textLabel] text];

            NSLog(@"--%@--", str);

    //        传值

            [[segue destinationViewController] setValue:str forKey:@"TheMusic"];

        }

        

    }

     

    试图跳转

     UIStoryboard *storyboard = self.storyboard;
            //此identifier在storyboard上相应页面对应的设置里填写,必须保持一致
            UIViewController *Identifier = [storyboard instantiateViewControllerWithIdentifier:@"ClockListIdentity"];

            [self presentViewController:Identifier animated:YES completion:nil];

     

    带navigation的

    只能用push(进栈)self.navigationController pushViewController:<#(UIViewController *)#> animated:<#(BOOL)#> //(进入下一视图)
    pop (出栈) self.navigationController popToViewController:<#(UIViewController *)#> animated:<#(BOOL)#> //(返回上一视图) 

  • 相关阅读:
    flask——flask-sqlachemy中的一对多,多对多关系
    flask——flask-sqlachemy的使用,模块划分
    Ubuntu下安装JDK和Open Jdk
    flask——全文检索
    Flask——部署
    在Ubuntu上安装Chrome浏览器和ChromeDriver
    jinja2模板语言的循环序号
    CentOS7安装mongodb
    CentOS7安装PhantomJS
    使用screen在后台运行程序
  • 原文地址:https://www.cnblogs.com/guanliyang/p/3796335.html
Copyright © 2011-2022 走看看