开发者

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

开发者 https://www.devze.com 2023-03-23 07:59 出处:网络
I am developing a static library. To implement two main functionalities, I have used totally 4 xibs. I have added those file to th开发者_运维技巧e Headers while building the SDK. But while using the S

I am developing a static library. To implement two main functionalities, I have used totally 4 xibs. I have added those file to th开发者_运维技巧e 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


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号