问题描述
我正在处理地图应用程式,
我尝试使用 [locationManager stopUpdatingLocation]; 方法停止定位服务。 / p>
它似乎在iOS4.3中可以正常工作,但在iOS5中,它不工作。
建议我如何在iOS5中停止位置服务?
有时会发生位置管理器即使在 stopUpdationLocations
您需要发布您的位置管理器
locationManager = nil;
这应该写在
之后code> [locationManager stopUpdatingLocation];
另外,注意不要调用locationManager对象,否则你的应用程序将崩溃
如果它仍然不停止位置服务,那么有解决方案,只是使用BOOL变量,如果你不想使用它在未来。
希望这有助于您!
I am working on map application,
I am try to use [locationManager stopUpdatingLocation]; method to stop the Location services.
It seems that it works fine in iOS4.3 but in iOS5, it's not working.
Please any one suggest me How to stop location services in iOS5?
Sometimes it happens that location manager does not stop even after stopUpdationLocations
You need to release your location manager, for that set
locationManager = nil;
This should be written after
[locationManager stopUpdatingLocation];
Also, take care you don't call locationManager object, after setting it to nil, else your application will get crashed
if it stills not stopping location services, then there is work around solution, just use BOOL variable if you dont want to use it in future.
hope this helps you!
这篇关于StopUpdatingLocation方法不适用于iOS5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!