【发布时间】:2013-05-20 04:21:50
【问题描述】:
如何在定位速度大于 20 时播放音频播放器,计数时间开始五秒以及突然定位时 速度(速度从 20 t0 0 降低)等于零它播放音频播放器。我尝试这个但没有发生任何事情请帮助我。这是我的代码
int i;
- (void)locationUpdate:(CLLocation *)location{
speedLabel.text = [NSString stringWithFormat:@"%.2fmph",[location speed]*2.236936284];
if (location.speed >= 10)
{
[self performSelector:@selector(doThis) withObject:nil afterDelay:5];
if (location.speed ==0) {
[audioPlayer play];
}
}
}
-(void)doThis{
if(i %5 == 0)
{
[CLController.locMgr startUpdatingLocation];
}
}
【问题讨论】:
-
什么增量“
i”?
标签: ios objective-c ios5 cllocation