1

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

2 Answers2

4

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.

Erre Efe
  • 15,387
  • 10
  • 45
  • 77
  • It is a static library project. I am using the method "initWithNibName:@"nibname"". I am not trying"nibname.xib". So what will be the issue here? Can not we add a xib file in a .a(static library) file – Sagar S. Kadookkunnan Jul 28 '11 at 12:52
  • For future reference: here is a more detailed answer: http://stackoverflow.com/a/796374/377384 – lindon fox Nov 19 '13 at 10:04
1

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.

Tushar Vengurlekar
  • 7,649
  • 8
  • 33
  • 48
  • It seemed to work for me to, in my parent project, go to 'Copy Bundle Resources' Build Phase for the Target, and use 'Add Other' to add the XIB files and other resources from the static library project to my parent project. – Ben Clayton May 11 '12 at 10:56
  • @tushar: You are the only guy who is supporting that It can be done. I tried all the solution, but it is not working for me at all. And just because you are confident enough I am trying harder to do that. Can you please help me with the steps. I am tired of experimenting. – Kumar Aditya Jan 16 '14 at 12:23