我正在使用 iOS SDK7.1。
在我的 View Controller 的 viewDidLoad 方法中,我创建了一个 CLLocationManager 对象并将它发送给 startUpdatingLocation 方法。
在 iOS 模拟器中,我可以更改位置,然后调用 locationManager:didUpdateLocations。
但是,似乎并没有在CLLocationManager对象接收到startUpdatindgLocation方法后立即调用locationManager:didUpdateLocations。
在 CLLocationManger 中 startUpdatingLocation 的文档中说: 调用此方法会导致位置管理器获取初始位置修复(这可能需要几秒钟)并通过调用其 locationManager:didUpdateLocations: 方法通知您的委托(delegate)。
基本上,我想在用户移动之前获取用户的位置。
最佳答案
关于iOS 模拟器、CLLocationManager、startUpdatingLocation 和 locationManager :didUpdateLocations,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26152679/