草庐IT

didChangeAuthorization

全部标签

ios - 更改状态后未调用 didChangeAuthorization Status

我遇到一个问题,在用户(1)接受或(2)拒绝我使用定位服务的请求后,locationManager:didChangeAuthorizationStatus没有被调用。通过放置不同的NSLog语句,我得出的结论是该方法在我请求授权时被调用,而不是在用户做出选择时被调用。有没有人有同样的问题?如果有,您是如何解决的?下面是我如何初始化我的位置管理器:if(_locationManager==nil){NSLog(@"Creatinglocationmanager");_locationManager=[[CLLocationManageralloc]init];_locationMana

ios - 单击允许后未调用 didChangeAuthorization Status

这是我实现谷歌地图和CLLocationManager的代码:classMapViewController:UIViewController{@IBOutletweakvarMapView:GMSMapView!varlocationmanager=CLLocationManager()overridefuncviewDidLoad(){super.viewDidLoad()locationmanager.delegate=selflocationmanager.requestWhenInUseAuthorization()}overridefuncdidReceiveMemoryWa