Is a MainController.xib file required for every iOS project? Reason I ask is because I have started to work on some programs, and I noticed that with some of the defaults there is no MainController.xib file generated.
If it is not generated by the template, does this mean that I have to create one myself using “Add File?”
I have a vague recollection of reading somewhere that MainController.xib generated the first view when the program loads but am not sure if this is correct?
Thank you.
It’s not required. As far as I know, none of the templates in Xcode 4.2 and 4.3 create a
MainController.xib.Your app’s
Info.plistcan contain the “Main nib file base name” key. The raw key isNSMainNibFile, and it also shows up on the app’s Summary screen as the “Main Interface” combo box.If this key has the value
MainController, then you need to have a nib namedMainController. The app will automatically load this when it is launched. You can set the value of the key to something else if you want to name your main nib something else. (I usually name mineMainInterface.)If you don’t include this key in your
Info.plist, then the app won’t automatically load a nib when it is launched.