gpt4 book ai didi

ios - Objective-C : Load storyboard from a pod/framework

转载 作者:行者123 更新时间:2023-11-28 18:47:08 25 4
gpt4 key购买 nike

我正在尝试加载位于 pod 的 .storyboard 中的 View Controller 。我正在使用通常有效的以下内容:

UIStoryboard *storyboard = [UIStoryboard 
storyboardWithName:@"StoryboardName" bundle:nil];
NewViewController *newView = [storyboard instantiateViewControllerWithIdentifier:@"NewViewController"];
[self.navigationController pushViewController:newView animated:YES];

我需要将其更改为什么才能从 pod 加载?

最佳答案

你应该用它的包标识符加载它

NSBundle* bun = [NSBundle bundleWithIdentifier:"id"]

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"StoryboardName" bundle:bun];

enter image description here

关于ios - Objective-C : Load storyboard from a pod/framework,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50354684/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com