How does Xcode determine which xib to load first? How can i change this?

I downloaded an Xcode project with three xib (A.xib, B.xib and C.xib). I noticed that:

  • None of them are called "MainWindow.xib".
  • In the project summary, the value of the Main interface is set to MainWindow
  • Primary nib master file name not set
  • Main.c does not specify the application delegate either int retVal = UIApplicationMain(argc, argv, nil, nil);

However, when I create & run, the application loads A.xib. How does the application decide what to download?

I am using Xcode 4 and I am targeting iOS 5. Thanks.

+4
source share
2 answers

You can set the Main Interface on the Summary tab of your target application.

See this image:

Main interface

EDIT: Or, as Alan wrote, you can install it in your info.plist file.

EDIT 2: A. I understand what the problem is. You can use MainWindow as the main .xib file, but you need to edit which .xib is loaded in MainWindow. Open MainWindow.xib and select the view controller that is used. If I'm right, his class is set to A If you want to use B.xib, you must change the class to B You will also need to set the NIB for the view controller in the Attributes Inspector.

Define the class for the UIViewController, which is used in MainWindow.xib:

Set the class

Install NIB:

Set the nib

+5
source

In your application Info.plist.

0
source

Source: https://habr.com/ru/post/1382398/


All Articles