Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/102.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 未显示位置访问权限警报,并且未在xcode 6.4中调用CLLocation manager委托方法。请告知_Ios_Core Location_Cllocationmanager - Fatal编程技术网

Ios 未显示位置访问权限警报,并且未在xcode 6.4中调用CLLocation manager委托方法。请告知

Ios 未显示位置访问权限警报,并且未在xcode 6.4中调用CLLocation manager委托方法。请告知,ios,core-location,cllocationmanager,Ios,Core Location,Cllocationmanager,我在目标C课上做过CLLocationmager。这里,我的代码是 CLLocationManager *loc = [[CLLocationManager alloc]init]; [loc setDelegate:self]; [loc requestWhenInUseAuthorization]; [loc requestAlwaysAuthorization]; loc.desiredAccuracy = kCLLocationAccuracyBest; loc.distanceFil

我在目标C课上做过CLLocationmager。这里,我的代码是

CLLocationManager *loc = [[CLLocationManager alloc]init];
[loc setDelegate:self];
[loc requestWhenInUseAuthorization];
[loc requestAlwaysAuthorization];
loc.desiredAccuracy = kCLLocationAccuracyBest; 
loc.distanceFilter = kCLHeadingFilterNone;
[loc startUpdatingLocation];
[loc startUpdatingHeading];
然后在.plist文件中添加隐私设置。 我仍然没有得到任何回应。

  • 创建CLLocationManager类的实例,并在应用程序中的某个位置存储对该类的强引用

    需要保持对location manager对象的强引用,直到涉及该对象的所有任务完成。因为大多数位置管理器任务是异步运行的,所以将位置管理器存储在局部变量中是不够的