我的进度条是这样编码的:
.h 文件
@interface ViewController : UIViewController {
IBOutlet UIProgressView *wait_progress;
double wait_time;
NSTimer *wait_timer;
}
-(void) increase_waiting_time;
.m 文件
-(void) increase_waiting_time {
wait_time = wait_time + 0.01;
wait_progress.progress = wait_time;
}
-(IBAction)start:(id)sender {
wait_timer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(increase_waiting_time) userInfo:nil repeats:YES];
}
如何在进度条加载后立即执行某些操作(这意味着 wait_time 将等于 1)?