Defined:
@interface Viewcontroller () { *testactivityindicator;}
Instantiate, start rotation:
-(void) showwaitstatus{NSLog (@"wait ..."); Testactivityindicator=[[Uiactivityindicatorview alloc] Initwithactivityindicatorstyle:uiactivityindicatorviewstylegra Y]; CGRect rect=Self.view.frame; Testactivityindicator.center= Cgpointmake (Rect.size.width/2, Rect.size.height/2); [Self.view Addsubview:testactivityindicator]; Testactivityindicator.color= [Uicolor Redcolor];//iOS5 introducing a specified color[Testactivityindicator startanimating];//Start Rotation[Testactivityindicator Sethideswhenstopped:yes];//Hide when rotation is over}- (void) viewdidload{[Super Viewdidload]; //additional setup after loading the view, typically from a nib.[self showwaitstatus];}
Stop Rotation:
-(void) Touchesbegan: (Nsset *) touches withevent: (uievent *)event{ [ Testactivityindicator stopanimating];}
IOS: Waiting for controls