我不明白为什么调用stopUpdatingLocation后灰色gps箭头不会消失。这是我的代码:-(void)viewDidLoad{[superviewDidLoad];//Doanyadditionalsetupafterloadingtheviewfromitsnib.if(self.locationManager==nil){self.locationManager=[[[CLLocationManageralloc]init]autorelease];self.locationManager.desiredAccuracy=kCLLocationAccuracyBest;s
为了在我的应用程序中节省电量,我决定在应用程序处于事件状态时混合使用startUpdatingLocation并在应用程序处于后台时进入startMonitoringSignificantLocationChanges模式。当应用程序进入后台时,我基本上会执行以下操作:-(void)applicationDidEnterBackground:(UIApplication*)application{[myLocationManagerstartMonitoringSignificantLocationChanges];}当应用程序返回前台时,我执行以下操作:-(void)applicat
当我的应用移至后台时,我调用了以下代码-[m_coreLocationManstopUpdatingLocation];但是,紫色三角形仍然存在。我是否还需要做其他事情才能成功? 最佳答案 这很简单,是一个经常发生的操作系统错误。我们在测试大型位置感知应用程序时注意到了这一点。在日常使用不同应用程序的过程中,我亲眼看到这种情况经常发生。 关于iphone-调用stopUpdatingLocation后紫色位置三角形不消失,我们在StackOverflow上找到一个类似的问题:
我有一个View有一个mapView的subview。我使用CLLocationManager获取当前位置并显示在map上。然后当View即将关闭时,我执行以下操作_mapView.delegate=nil;_mapView=nil;[_locationManagerstopUpdatingLocation];_locationManager.delegate=nil;_locationManager=nil;但是状态栏上的位置服务(GPS)指示器仍然存在,没有消失。当应用程序进入后台然后返回前台时,它会等待指示器显示在状态栏上,然后再激活。指标还存在的原因是什么?编辑-以下是CLLo
问题:我似乎无法阻止CoreLocation向我的应用/跟踪发送更新。我在做什么:在我的viewWillAppear中,我调用了self.locationManager并将其传递给一个方法以在map上显示用户的位置(MKMapView的实例)。覆盖getter以检查服务的可用性,以查看其是否已授权。如果是这样,它将allocs/inits和startMonitoringSignificantLocationChanges并返回。在viewDidDisappear中,我调用了[self.locationManagerstopUpdatingLocation]。但我仍然可以在状态栏中看到位