Location services don't stop when application is terminated

前端 未结 7 1380
感动是毒
感动是毒 2021-01-04 18:28

I\'m currently developing an iPhone application which needs location services for various use including AR.

I test everything on simulator and on my iPhone 3GS and e

7条回答
  •  粉色の甜心
    2021-01-04 19:00

    This is the solution which fixed this problem for me.

    Just stop monitering location changes in

    - (void) applicationDidEnterBackground: (UIApplication *)application
    {
        [locationManager stopMonitoringSignificantLocationChanges];
        locationManager.delegate = nil;
    }
    

    not in applicationWillEnterForeground: .Still,it takes a few seconds to disappear locating icon.

    I don't know why it isn't working in the latter method.

提交回复
热议问题