Whether Nib(.xib) files can be added to a Static Library?

前提是你 提交于 2019-12-11 05:46:23

问题


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


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/6859143/whether-nib-xib-files-can-be-added-to-a-static-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!