Tsu*_*sai 4 bundle storyboard ios
我创建了一个包文件并将包文件导入到我的项目中.这个捆绑文件中有一个故事板,我想从这个故事板创建视图.我一直试图找出正确的方法来做这2天,但没有运气.它始终显示"'无法在捆绑NSBundle中找到名为'StoryboardA'的故事板"错误.我在这里有一个示例项目:https://github.com/tsunglintsai/Storyboard-In-Resource-Bundle.
以下是我试过的代码.
NSBundle *resourceBundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"bundlefilename" ofType:@"bundle"]];
[resourceBundle load];
NSLog(@"resourceBundle:%@",resourceBundle);
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"StoryboardA" bundle:resourceBundle];
UIViewController *vc = [sb instantiateViewControllerWithIdentifier:@"myViewController"];
vc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:vc animated:YES completion:NULL];
Run Code Online (Sandbox Code Playgroud)
- 我无法从以下类似问题的帖子中找到答案:
| 归档时间: |
|
| 查看次数: |
5270 次 |
| 最近记录: |