有没有办法使用CLLocationManager请求一个一次性的位置,相当于说“当我按下这个按钮时,告诉我我在哪里”,或者这只是一个呼叫的情况
[locationManager startUpdatingLocation];
// and implementing: locationManager:didUpdateToLocation:fromLocation:
[locationManager stopUpdatingLocation];发布于 2010-11-25 01:56:42
简短的回答是:不。
获取位置可能需要一些时间,这就是CLLocationManager使用委托的原因。必须在回调locationManager:didUpdateToLocation:fromLocation:中调用stopUpdating location。
https://stackoverflow.com/questions/4269923
复制相似问题