First, the view test.storyboard Name of the controller that was created by the code load storyboard file is the file name, and the following storyboard is the filename extension
1. This method is called after the application starts, and is no longer called after it is started!
If the application is killed by the operating system due to memory and other reasons, clicking the icon again will call this method!
-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (nsdictionary *) launchOptions
{
Instantiate UIWindow, Special UIView
Self.window = [[UIWindow alloc] Initwithframe:[uiscreen mainscreen].bounds];
Set the background color of a window
Self.window.backgroundColor = [Uicolor Whitecolor]; 1. Load the storyboard file first (test is the file name of storyboard)
Uistoryboard*storyboard = [Uistoryboard storyboardwithname:@ "Test" bundle:nil]; Bundle Pass Nil The default is the main bundle
2, then initialize the Controller method in the storyboard 1, initialize the "Initial controller" (storyboard the arrow refers to the Controller) Mjviewcontroller *MJ = [Storyboard Instantiateinitialviewcontroller];
Method 2,Initialize the corresponding controller via an identity Mjviewcontroller *MJ = [Storyboard instantiateviewcontrollerwithidentifier:@ "Pink"];
Adding identifiersTo add a view control to the root view of the Windows window
Self.window.rootViewController =; MJ
Turn the window into the main window and visible
[Self.window makekeyandvisible];
return YES;
}
second, load the main storyboard file through the project SetupIt is
better to click the arrow to select (manual input should be careful not to add a space) or it will not be read out
Controller controllers in the same Code load storyboard