【发布时间】:2012-07-27 13:40:15
【问题描述】:
我正在寻找一种方法来在我的 iOS 应用程序中每 n 分钟更新一次后台位置。现在我每秒都会更新一次。我可以将一秒更改为三秒或四秒或每分钟吗.. .
这是我的代码:
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
if([self.delegate conformsToProtocol:@protocol(GPSLocationDelegate)]) {
// Check if the class assigning itself as the delegate conforms to our protocol. If not, the message will go nowhere. Not good.
[self.delegate locationUpdate:newLocation];
NSLog(@"location manager");
/// alert for check msg ////
////////////////////////////
}
}
【问题讨论】:
标签: iphone objective-c ios ios5 gps