首页 > 其他 > 详细

Storyboard跳转传值

时间:2016-03-16 18:42:57      阅读:165      评论:0      收藏:0      [点我收藏+]

1、 Storyboard 模态(或Pop)指定控制器

UIStoryboard *sb_board = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
LoginController *vc_login = [sb_board instantiateViewControllerWithIdentifier:@"LoginController"];
[self  presentViewController:vc_login animated:YES completion:nil];

2、 Storyboard Pop回指定控制器

UIStoryboard *sb_board = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
CateWebController *vc_cate_web = [sb_board instantiateViewControllerWithIdentifier:@"CateWebController"];
for (UIViewController* vc in self.navigationController.viewControllers) {
  if ([vc isKindOfClass:[vc_cate_web class]]) {
    [self.navigationController popToViewController:vc animated:YES];
  }
}

 3、Storyboard(相连接)直接跳转

 self.hidesBottomBarWhenPushed = YES;
[self performSegueWithIdentifier:Identifier sender:self];
self.hidesBottomBarWhenPushed = YES;

  4、Storyboard(相连接)传值

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
    if ([segue.identifier isEqualToString:@"SegueDetail"])
    {
         DetailController *Detail = segue.destinationViewController;
         Detail.strUrl = [NSString stringWithFormat:@"%@",self.str_url];

    }
}

 

Storyboard跳转传值

原文:http://www.cnblogs.com/superbobo/p/5284513.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!