0
我开发了iOS应用程序。停止应用时停止位置
我有一个位置管理器让我的位置,当我在应用程序中。
当我进入后台状态时,我希望我的位置不断更新,并在发生更改时发送本地通知。 (这部分是确定的)。
我的问题是位置管理器仍然使用位置时,我杀了应用程序。
我想在应用程序终止时停止位置更新。
我尝试使用此功能:
- (void) applicationWillTerminate
但它从未进入此功能...
任何想法?
谢谢大家。
您是否在监控区域? – Pfitz
不,当我启动我的locationManager时,我这样做:self.locationManager.desiredAccuracy = kCLLocationAccuracyBest; self.locationManager.delegate = self; self.locationManager.distanceFilter = 200.0f; self.currentLocation = nil; [self.locationManager startUpdatingLocation]; – user1448932
你想让你的应用程序在后台运行吗?或者当用户关闭它时完全退出? 'applicationWillTerminate:'在用户关闭你的应用程序时不会被调用,并且会进入后台。 – Nate