Ios 从捆绑包加载自定义视图控制器失败-“;接口生成器文件“中的未知类”;

Ios 从捆绑包加载自定义视图控制器失败-“;接口生成器文件“中的未知类”;,ios,xcode,uiviewcontroller,bundle,Ios,Xcode,Uiviewcontroller,Bundle,我使用下面的代码从一个捆绑包中展示初始视图控制器 NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/ReMoreTesting.bundle"]; NSBundle *bun = [NSBundle bundleWithPath:path]; UIStoryboard *sb = [UIStoryboard storyboardWithName:@"ReMoreTesting" bundle:

我使用下面的代码从一个捆绑包中展示初始视图控制器

NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/ReMoreTesting.bundle"];
NSBundle *bun = [NSBundle bundleWithPath:path];
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"ReMoreTesting" bundle:bun];
UIViewController *vc = [sb instantiateInitialViewController];
[self presentViewController:vc animated:YES completion:NULL];
但是,
presentViewControllerAnimated:completion
会导致记录错误:“Interface Builder文件中的未知类RMTViewController”。布局加载良好,但如果单击依赖于RMTViewController的内容(标准ViewController定义中没有的内容),它将与“无法识别的选择器”一起崩溃

在我看来,故事板文件正在加载,但是编译并存储在同一个包中的类文件没有被调用。我是否缺少指定在何处查找该类的内容

谢谢


此外,是的,这是一个动态加载的库,我知道该应用程序提交到应用商店不会通过苹果的批准。此外,我还可以通过其他方法成功访问代码。

在发布此问题时,我发现了问题所在。我想我无论如何都会把它贴出来

事实证明,加载故事板并不同时加载捆绑包的库。在实例化情节提要之前调用
[bun load]
解决了这个问题

事后看来一切都很容易,是吗