- (void) viewdidload{[Super Viewdidload]; //additional setup after loading the view, typically from a nib. //uiapplication *app = [uiapplication sharedapplication];//uiapplication *app1 = [uiapplication sharedapplication];////UIApplication *app2 = [[UIApplication alloc] init];//NSLog (@ "%p-%p", app, App1);UIButton*BTN = [[UIButton alloc] Initwithframe:cgrectmake ( -, -, -, -)]; [BTN Settitle:@"dot me."Forstate:uicontrolstatenormal]; [Btn addtarget:self Action: @selector (OnClick) forcontrolevents:uicontroleventtouchupinside]; Btn.backgroundcolor=[Uicolor Redcolor]; [Self.view addsubview:btn];}- (void) onclick{//NSLog (@ "been ordered");UIApplication *app =[UIApplication sharedapplication]; //set the number on the application icon//app.applicationiconbadgenumber = 998; //set up a networking animation for the status bar//app.networkactivityindicatorvisible = YES; //set the style of the status bar//app.statusbarstyle = uistatusbarstylelightcontent;//[app Setstatusbarstyle:uistatusbarstylelightcontent Animated:yes]; //set whether the status bar is hidden//App.statusbarhidden = YES;//[app Setstatusbarhidden:yes Withanimation:uistatusbaranimationfade]; /*URL: Uniform Resource Locator, which is used to uniquely represent a resource URL: protocol header://Host address/resource Path network resource:Http://www.baidu.com/images/20140603/abc.pngLocal resources: File:///users/apple/desktop/abc.png*/Nsurl*url = [Nsurl urlwithstring:@"http://ios.itcast.cn"]; [App Openurl:url];}//-(Uistatusbarstyle) Preferredstatusbarstyle//{//return uistatusbarstylelightcontent;//}//-(BOOL) Prefersstatusbarhidden//{//return YES;//}
IOS uiapplication Use