代码创建storyboard

来源:互联网 发布:时代软件工作室 编辑:程序博客网 时间:2024/06/03 14:06

代码创建storyboard方式如下


//加载storyboard

UIStoryboard*storyboard = [UIStoryboardStoryboardWithName:@"storyboard名称"bundle:nil];


// 创建storyboard里面箭头所指的控制器

* UIViewControl *vc = [storyboardinstantiateInitialViewController];

* UIViewControl *vc = [storyboardinstantiateInitialViewControllerWithIdentifier:@"控制器的ID"];


// storyboard里面箭头所指的控制器作为window的根控制器

self.window.rootViewControl= vc;


如果有错或有什么问题请联系我,转载请注明出处,谢谢!

0 0