I have started a project in Xcode 3.x using the “Create a Window-Based Application” option. The project seems to load the main nib file by itself from the info.plist entry : “Main nib file base name”.
Now I wish to load the main nib file using a UIViewController. Can I just delete the info.plist entry and load the nib file programmatically in “application: didFinishLaunchingWithOptions:” using a view controller ?
(Now the project has been moved to Xcode 4.2. But I guess the compiler version shouldn’t matter much for this case …)
Hope that somebody knowledgable in this area could help …
If you are upgrading the same project then no you can not just do that.
The mechanism Apple is using in their templates for getting into the app has changed between these versions.
In 3.x the
Main Interfaceis set toMainWindow.xibin your project settings. In thisxibyour app delegate is loaded as an object.In 4.x the
main.mspecifically loads the app delegate with this line:it’s the last argument that has changed between 3.x and 4.x
Your best bet is to create a new project and see how the template code has it all wired up.
UPDATE
First off if your project is working do you really need to change it?
If so then I’m using the template code from a fresh project
Go to your
main.mand change the implementation fromto
NB Change
AppDelegateto the name of your app delegate class.You will also need to update your app delegate to create the
UIWindowprogramatically.These are the most obvious differences I can think of, there may be some other subtitles but I’ve not used 3.x in so long I can’t remember.