我有一个NSTimer
这样的:
[NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(sliderUpdate:) userInfo:nil repeats:YES];
-(void)sliderUpdate:(id)sender
{
int currentTime = (int)((newPlayer.currentTime.value)/newPlayer.currentTime.timescale);
slider.value=currentTime;
NSLog(@"%i",currentTime);
song.currentTime=currentTime;
int currentPoint=(int)((newPlayer.currentTime.value)/newPlayer.currentTime.timescale);
int pointMins=(int)(currentPoint/60);
int pointSec=(int)(currentPoint%60);
NSString *strMinlabel=[NSString stringWithFormat:@"%02d:%02d",pointMins,pointSec];
lblSlidermin.text=strMinlabel;
song.strslidermin=strMinlabel;
}
我想要做的是,每 45 秒调用一次 Web 服务:
示例:45 秒内第一次调用,90 秒内第二次,等等。
我怎样才能在这个 NSTimer 中做到这一点?