xcode – 如何使用延迟位置iOS 6?
我正在尝试使用新的iOS 6功能的自定义位置更新,但继续收到此错误:
我使用以下代码: - (DeviceAPI *) init { locationManager = [[CLLocationManager alloc] init]; [locationManager setDelegate:self]; [locationManager setDesiredAccuracy:kCLLocationAccuracyBest]; [locationManager startUpdatingLocation]; [locationManager allowDeferredLocationUpdatesUntilTraveled:(CLLocationDistance)100000 timeout:(NSTimeInterval)100000]; return self; } 而这个回调函数: - (void)locationManager: (CLLocationManager *) manager didFinishDeferredUpdatesWithError:(NSError *)error { NSLog(@"didFinishDeferredUpdatesWithError :%@",[error description]); } 有帮助吗? 解决方法
根据适用于iOS 6.0 SDK的Apple Developer论坛,延迟位置更新仅适用于:
>在iPhone 5硬件上 见:https://devforums.apple.com/message/751974#751974 见文档: 所以听起来你需要iPhone 5硬件,等待位置更新以1Hz的速度进入. 另外,正如另一张海报所提到的,您需要在委托中实现locationManager:didUpdateLocations:方法.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |