We are experimenting with delivering our nibs in language specific bundles. For a couple of different reasons this would help us out.
My questions are around setting up a resource only bundle.
- When I add a new bundle in xcode through the “New Project - Framework & Library - Bundle” menu xcode will add a new xcodeproj file. Is this correct? I thought a bundle was just a directory with a .bundle extension.
- If I want to only have nib files in my bundle do I still need an executable file and a info.plist file?
So far I have manually created a bundle directory and added nib files. I and can access it with
NSBundle bundleWithPath
Not sure if it's loaded correctly, but the bundleWithPath method does not return nil.
But when I try to open a nib file from the bundle I get the following error:
* Terminating app due to uncaught exception 'NSInternalInco nsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle (not yet loaded)' with name 'Nib''
And I have added the bundle to "Copy Bundle Resources".
Thanks for any info. I'm sure I'm making this harder than it should be.
EDIT: I went back and for a test added the line below to look for the xib instead of the nib. It works for xib but not for nib. I think this means that that the xib maybe is not getting compiled.
[languageBundle pathForResource:@"TestNib" ofType:@"xib"];