2

I have made one static library which contains some nibs. When I try to load those nib files, I am getting Could not load NIB in bundle: 'NSBundle. If anyone knows how to do this, it will be very helpful. Thanks

BhushanVU
  • 3,455
  • 1
  • 24
  • 33

3 Answers3

3

Existed answer : Can you reference Xib files from static libraries on the iPhone?

No you can't use this way,

A static library is a file that contains classes. It does not contain other files, it is essentially a database of compiled code.Even it is possible to put the data for the xibs in static library,But Xcode won't recognize that it was in there.

Community
  • 1
  • 1
Vedchi
  • 1,200
  • 6
  • 14
0

when you allocate your controller init it with nib from main bundle.

[initWithNibName:@"Your nib.." bundle:[NsBundle MainBundle]]

Agent Chocks.
  • 1,312
  • 8
  • 19
0

If you are not getting linked or not getting referred by main project, then checkout following steps once, & make sure that You are not missing anything

  1. Go to your xib (i.e. MyViewController)
    1. Open File Inspector
    2. Select File's Owner
    3. Select 3rd tab from File's Inspector
    4. Go into Custom Class section
    5. Check the class name
Niru Mukund Shah
  • 4,637
  • 2
  • 20
  • 34