See note!
-(Ibaction) Starttomove: (ID) Sender {//determine if the rotation//Stopanimating method is to stop the animation effect if ([Self.myactivityindicatorview IsAni Mating]) {[Self.myactivityindicatorview stopanimating]; } else {[Self.myactivityindicatorview startanimating]; }}-(ibaction) downloadprogress: (ID) Sender {//Timer method: Send a message to an object after a specific time interval//target to which object to send the message//TimeInterval interval //Selector The method name to invoke//UserInfo the parameter sent to the message//repeats whether to repeat MyTimer = [Nstimer scheduledtimerwithtimeinterval:1 .0 target:self Selector: @selec Tor (download) Userinfo:nil Repe Ats:yes];} -(void) download{self.myProgressView.progress + = 0.1;/Set Step length if (self.myProgressView.progress = = 1.0) {//If the progress bar is to Head up//termination timer [MyTimer invalidate]; Popup dialog box Uialertview *alert = [[Uialertview alloc]initwithtitle:@ "Download completed!" message:@ "hey! lucy! " Delegate:nil cancelbuttontitle: @ "ok!" Otherbuttontitles:nil, nil]; [Alert show]; }}
Timers and Progress Bars (iOS development)