iPhone开发 UIProgressView与计时器一起使用

-(IBAction)btnStartClick

{

    proValue=0;

    timer = [NSTimerscheduledTimerWithTimeInterval:0.001target:selfselector:@selector(changeProgress) userInfo:nilrepeats:YES];

}

-(void)changeProgress

{

    proValue +=1.0;

    if(proValue > 1500)

    {

        //停用计时器

        [timer invalidate];        

    }

    else

    {

        [proView setProgress:(proValue/1500)];

    }

}

posted @ 2012-02-14 14:44  凡娃软件  阅读(656)  评论(0)    收藏  举报