@interface appdelegate () @property uilabel* Show; @end @implementation appdelegate-(BOOL) Application: (UIApplication *) Application didfinishlaunchingwithoptions: (nsdictionary *) launchoptions{Self.window = [[UIWindow alloc] Initwithframe:[[uiscreen Mainscreen] bounds]; Override point for customization after application launch. Self.window.backgroundColor = [Uicolor Whitecolor]; Create a Uiviewcontroller object uiviewcontroller* controller = [[Uiviewcontroller alloc] init]; Let the program's window load and display the user interface associated with the Viewcontroller view Controller Self.window.rootViewController = controller; Create a UIView object uiview* rootview = [[UIView alloc] initwithframe:[[uiscreen mainscreen] bounds]]; Set controller display Rootview control Controller.view = Rootview; Create a rounded button uibutton* buttons = [UIButton buttonwithtype:uibuttontyperoundedrect]; Set the size of the button Button.frame = CGRectMake (120, 100, 80, 40); Set the text for the button [button settitle:@ "OK" forstate:uicontrolstatenormal]; Add a button to the Rootview control [Rootview Addsubview:button]; Create a UILabel object self.show = [[UILabel alloc] Initwithframe:cgrectmake ($, +, +)];//uilabel* show = [Uilab El Alloc] Initwithframe:cgrectmake (60, 40, 180, 30)]; Add Uilabel to the Rootview control [Rootview AddSubview:self.show]; Sets UILabel default display of text Self.show.text = @ "initial text"; Self.show.backgroundColor = [Uicolor Graycolor]; Event handling method for touch event binding for Fillet buttons [button addtarget:self action: @selector (ClickHandler:) forControlEvents: UIControlEventTouchUpInside]; Set the UIWindow object as the main window and display it [Self.window makekeyandvisible]; return YES;}
-(void) ClickHandler: (ID) Sender { Self.show.text = @ "Start learning IOS!" ";}
IOS code creates controls and has handling events