.h
UIProgressView *progress;
NSTimer *progressTimer;
double proValue;
.m
progress = [[UIProgressView alloc] initWithFrame:CGRectMake(30, 240, 255, 30)];
[loadingImage addSubview:progress];
proValue=0;
progressTimer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:selfselector:@selector(changeProgress) userInfo:nil repeats:YES];
-(void)changeProgress
{
proValue += 0.1; //改变proValue的值
if(proValue > 5)
{
//停用计时器
[progressTimer invalidate];
}
else
{
[progress setProgress:(proValue / 5)];//重置进度条
}
}