【发布时间】:2014-10-30 06:13:00
【问题描述】:
我正在使用核心位置我的开发目标是 5.0 下面是我开始更新的代码
self.locationManager = [[CLLocationManager alloc]init];
[self.locationManager setDelegate:self];
[self.locationManager startUpdatingLocation];
下面是委托方法
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
// Do Something Here
}
它在 iOS 5.0 和 6.0 中调用,但在 iOS 7.0 之后被弃用 所以对于 iOS 7.0 及以上我必须在下面使用
- (void)locationManager:(CLLocationManager *)manager
didUpdateLocations:(NSArray *)locations
{
// Do Something Here
}
我的问题是我是否必须为 7.0 以下和 7.0 以上的 iOS 管理两个单独的委托方法?
如果不是请详细解释我。
【问题讨论】:
标签: ios objective-c xcode gps core-location