你如何从一个框架中调用一个nib文件,比如:
myFramework/Resources/a.nib我已经构建了框架(使用来自kstenerud的iOS-Universal-Framework MK )并安装在测试应用程序中,但似乎找不到直接引用nib文件的方法。
[[NSBundle mainBundle] pathForResource:@"BarViewController_iPhone" ofType:@"nib"]
returns nil.
barViewController = [[BarViewController alloc] initWithNibName:@"BarViewController_iPhone" bundle:nil]; also does not work.其中nib文件名为BarViewController_iPhone.nib。它返回nil。
我还尝试用[NSBundle bundleIdentifier]引用我的框架,但我的框架的id为空。如何在构建框架时设置id?
如有任何建议,我们将不胜感激!
发布于 2012-02-28 05:24:09
将评论转发为答案:
因为这个问题已经存在了一个线程,它包含了很多有用的信息和对这个问题的答案。
点击此处阅读:Can you reference Xib files from static libraries on the iPhone?
https://stackoverflow.com/questions/9471968
复制相似问题