我正在寻找一种方法来在我的 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 ////
////////////////////////////
}
}