码迷,mamicode.com
首页 > 其他好文 > 详细

xib、stroyboard加载view、viewController

时间:2015-09-14 22:47:01      阅读:273      评论:0      收藏:0      [点我收藏+]

标签:

1、Storyboard加载

- (void)addButtonDidClickedAction:(UIButton *)sender{

    NSLog(@"%s,%d", __FUNCTION__,__LINE__);
    
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"main" bundle:nil];
    BCCAddJizhangViewController *addJizhangVC = [storyboard instantiateViewControllerWithIdentifier:@"BCCAddJizhangViewController"];
    addJizhangVC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    addJizhangVC.delegaete = self;
    [self presentViewController:addJizhangVC animated:YES completion:nil];
}

 2、 代码加载xib---view

NSArray *nibContents = [[NSBundle mainBundle] loadNibNamed:@"BCCJiZhangTitleView" owner:nil options:nil];
    BCCJiZhangTitleView *titleView = [nibContents firstObject];

 3、代码加载xib---viewController

BCCMingxiCellDetailedViewController *mxVC = [[[NSBundle mainBundle] loadNibNamed:@"BCCMingxiCellDetailedViewController" owner:nil options:nil] lastObject];

 

xib、stroyboard加载view、viewController

标签:

原文地址:http://www.cnblogs.com/bachl/p/4808364.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!