Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I really need a MainWindow.xib file?

I have an iPad 4.3 project that doesn't have a MainWindow.xib because it's main view is created programmatically. Everything seems to work fine but I noticed that in my plist file there's a value for a NSMainNibFile key that has "MainWindow" for value. If I change in any way that entry, my app won't work. Now, that's strange, at least for me...

like image 537
Alex Escalante Avatar asked Apr 13 '11 01:04

Alex Escalante


3 Answers

If you remove the xib reference in the target properties, be sure to change your code in main.m to refer to your class delegate class.

int retVal = UIApplicationMain(argc, argv, nil, @"YourAppDelegateClassName");
like image 169
futureelite7 Avatar answered Oct 16 '22 05:10

futureelite7


If you remove the NSMainNibFile key from your Info.plist, you need to update the code for main.m. You will need to update the NSString *delegateClassName in the call to UIApplicationMain.

like image 37
Black Frog Avatar answered Oct 16 '22 05:10

Black Frog


No you don't necessarily need something called MainWindow.xib you could rename everywhere but as this answer points out you have to have something for the application to start with; What's the MainWindow.xib nib file for?

like image 1
Dave Anderson Avatar answered Oct 16 '22 06:10

Dave Anderson