I am simulating an "iPhone-only" app in iPad. The binary simulates fine in the iPhone simulator, but when attempting to simulate in the iPad, the initial background image appears, but then the screen just goes black. (Xcode v4.1, SDK 4.1)
The app has only one view, which is controlled by a single custom UIViewController. (SoloViewController) The only view managed by SoloViewController is contained in a "detached" nib called "mainview.xib".
I initialize the SoloViewController in my AppDelegate like so:
- (void)applicationDidFinishLaunching:(UIApplication *)application {
SoloViewController *vc = [[SoloViewController alloc] initWithNibName:@"mainview" bundle:[NSBundle mainBundle]];
self.soloViewController=vc;
[vc release];
[window addSubview:[soloViewController view]];
[window makeKeyAndVisible];
}
My Info.plist file has the "Main nib file base name" set to "MainWindow", which I believe is the default Xcode gives you when you first create a ViewController-based project. Anyway, I just left that as-is. However, when attempting to simulate in iPad, the log says:
Failed to load NSMainNibFile MainWindow.
iPhone simulator and hardware have no problem with this...
If I set the "Main nib file base name" key to "mainview" to use the xib file for the view, I get this error:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x7a01270> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.'
I've double-checked the xib in IB and all of the outlets are properly defined and connected to SoloViewController.h & SoloViewController.m. What am I doing wrong here!?
Also - if I leave the NSMainNibFile blank, then the iPhone simulator just comes up with a black screen. (no errors in log)