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)#> //(返回上一视图) 

  • 相关阅读:
    商人的诀窍 结构体
    商人的诀窍 结构体
    小泉的难题 结构体
    小泉的难题 结构体
    来淄博旅游 结构体
    来淄博旅游 结构体
    分类游戏 结构体
    7月20日学习
    7月19日学习
    7月18日学习
  • 原文地址:https://www.cnblogs.com/guanliyang/p/3796335.html
Copyright © 2011-2022 走看看