Nib(.xib) 文件是否可以添加到静态库中?
我正在开发一个静态库。为了实现两个主要功能,我总共使用了 4 个 xib。我在构建 SDK 时已将这些文件添加到标头中。但是,在其他项目中使用 SDK 作为实现时,我收到如下错误:“由于未捕获的异常‘NSInternalInconsistencyException’而终止应用程序,原因:‘无法在捆绑包中加载 NIB’”
任何人都可以快速给出答案。我需要更改视图控制器吗?这个时候会非常痛苦。
谢谢
I am developing a static library. To implement two main functionalities, I have used totally 4 xibs. I have added those file to the Headers while building the SDK. But while using the SDK in some other project as implementation, I am getting an error like : "Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle"
Can anyone give an answer quickly. Do I need to change the view controller? It will be much painful at this time.
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于您使用的是静态库(与捆绑包不同),所以不能。
静态库是一个包含由库创建者链接在一起的类、代码和变量的单个文件。它不包含 XIB 那样的其他文件,它本质上是编译代码的数据库。
As you're using a static library (wich is not the same as bundle), you can't.
A static library is a single file that contains classes, code and variables that were linked together by the library creator. It does not contain other files as XIB ones, it is essentially a database of compiled code.
是的,你可以。就像对任何普通项目所做的那样,在您的库中添加一个 xib 文件。然后在库项目目标中将 xib 文件与 .a 文件一起添加到复制文件部分。
在使用库的主项目中,将 xib 文件拖放到库的 .a 文件所在的位置。
Yes You can. add a xib file in your library as you would do for any normal project. Then in library project target add the xib file in copy Files section along with .a file.
In your main project where you are using the library, drag and drop the xib file where .a file for library is located.