Tag: and object its finish SDI window needs har to decide
//Once the program is started, it is called once .-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (Nsdictionary *) launchoptions{//1. Create UIWindowSelf.window =[[UIWindow alloc] initwithframe:[[uiscreen mainscreen] bounds]; //set the background color of UIWindowSelf.window.backgroundColor =[Uicolor Redcolor]; //let the UIWindow show up (let the window be the main window and show it)//an application can have only one main window[Self.window makekeyandvisible]; //let UIWindow become the main window//[Self.window Makekeywindow]; //2. Create a window againUIWindow *w2 = [[UIWindow alloc] Initwithframe:cgrectmake ( -, -, $, $)]; W2.backgroundcolor=[Uicolor Yellowcolor]; [W2 Makekeyandvisible]; SELF.W2=W2; //3. Create two text input boxes//3.1 Adding a text input box to a windowUitextfield *tx1 = [[Uitextfield alloc] Initwithframe:cgrectmake (Ten,Ten, $, +)]; Tx1.borderstyle=Uitextborderstyleroundedrect; [Self.window ADDSUBVIEW:TX1]; //3.2 Adding a text input box to the W2Uitextfield *tx2 = [[Uitextfield alloc] Initwithframe:cgrectmake (Ten,Ten, -, +)]; Tx2.borderstyle=Uitextborderstyleroundedrect; [Self.w2 ADDSUBVIEW:TX2]; //get the main window of the applicationNSLog (@"%@", [uiapplication Sharedapplication].keywindow); returnYES;}- (void) test{//1. Create UIWindowSelf.window =[[UIWindow alloc] initwithframe:[[uiscreen mainscreen] bounds]; //2. Set the background color of the UIWindowSelf.window.backgroundColor =[Uicolor Redcolor]; //Create a controller//Njviewcontroller *VC = [[Njviewcontroller alloc] init]; //Add a view of the controller to the UIWindow//Issue 1: When the view has some events, notify the controller, but the controller and destroyed, so there may be an unknown error /*Issue 2: When a rotation event occurs, the UIApplication object passes the rotation event to the UIWindow UIWindow and then passes the rotation event to its root controller, which is determined by the root controller whether it needs to be rotated uiapplication- >UIWindow-> Root Controller*/ //[Self.window AddSubview:vc.view]; //set the root controller for UIWindow (this is the recommended way)//Self.window.rootViewController = VC; //Uiswitch *switchbtn = [[Uiswitch alloc] init]; //[Self.window addsubview:switchbtn]; //3. Let the UIWindow appear (make the window the main window and show it)//an application can have only one main window[Self.window makekeyandvisible]; //let UIWindow become the main window//[Self.window Makekeywindow];}
The IOS Windows window uses