I'm developing an iPhone app that is a "module" of another launcher (it doesn't launch from the iPhone home screen). To add this module to the launcher, I have to drop in the xcode file into the parent xcode project (creating a subproject). The subproject uses a NIB file as its view controller and the subproject loads the file using initWithNib:
root_view_controller = [[UINavigationController alloc] initWithRootViewController:[[LMU_IP_RootView alloc] initWithNibName:@"LMU_IP_RootView" bundle:nil]];
When I try to run the parent project, it crashes with:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle [...] (loaded)' with name 'LMU_IP_RootView''
I'm guessing its because it can't find the NIB file because the root bundle is now the parent project instead of the subproject. I could include the NIB in the parent project and that fixes the error, but doesn't solve my problem.
So my question: How do I use InterfaceBuilder files in a subproject? Do I have to specify a bundle? How do I specify a bundle that refers to this subproject?
Thanks!