How does Xcode load the main storyboard?

后端 未结 7 1218
遥遥无期
遥遥无期 2020-12-13 08:37

When I create a new single view application in Xcode 4.6 using storyboard, we can see that the main function creates a new application using the application delegate like th

7条回答
  •  萌比男神i
    2020-12-13 08:57

    It is started from the UIMainStoryboardFile setting from your info.plist file. Xcode then creates a main window, instantiates your first view controller, and adds it to the window. You can still do this in code similar to the .nib using

    UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
    UIViewController* initialView = [storyboard instantiateInitialViewController];
    

提交回复
热议问题