StopUpdatingLocation method not working for iOS5

前端 未结 2 845
南笙
南笙 2021-01-06 03:37

I am working on map application,

I am try to use [locationManager stopUpdatingLocation]; method to stop the Location services.

It seems that it

2条回答
  •  梦谈多话
    2021-01-06 03:52

    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 crash.

    If it stills not stopping location services, then there is work around solution, just use BOOL variable if you don't want to use it in future.

提交回复
热议问题