ios4、ios5界面跳转

ios4、ios5在跳转上有些区别:

push跳转(ios4、ios5):

SearchDetailViewController *sView = [[SearchDetailViewController alloc] init];
        [self.navigationController pushViewController:sView animated:YES];
        [sView release];//ios5不需要这行


push需要头部有navigationControll才能跳转,普通ViewControll是不能跳转的,普通ViewController只能用Modal进跳转。

modal跳转(ios4、ios5):

ZbarViewController *zVC = [[ZbarViewController alloc] initWithNibName:@"ZbarViewController" bundle:nil];
    [self presentModalViewController:zVC animated:YES];

//传参(写在跳转后面)

zVC.flag = true;


返回到上一界面:

[self.navigationController popViewControllerAnimated:YES];//push

[self dismissModalViewControllerAnimated:YES];//modal


ios5由于运用了storyboard又多了几种跳转方式:

手动跳转

UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];

PriceRecordViewController *prVC = [mainStoryboard instantiateViewControllerWithIdentifier:@"priceRecord_ID"];
        prVC.auctionIdStr = auctionIdStr;
        [self.navigationController pushViewController:prVC animated:YES];


如果运用了storyboard可如下跳转:

[self performSegueWithIdentifier:@"biddingTOauctionDetail" sender:auctionIdStr];

sender用于发送需要传的对象。

用storyboard跳转传值方法:

//场景传值(传多个值)
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
    AuctionDetailsViewController *advc = segue.destinationViewController;
    advc.auctionIdStr = sender;
    advc.speedBidTypeStr = speedBidTypeStr;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值