问题
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