Ios 位置服务错误
我的应用程序使用核心位置。初始化后,我访问位置管理器的唯一位置是在代理中,我在其中获取当前位置:Ios 位置服务错误,ios,core-location,Ios,Core Location,我的应用程序使用核心位置。初始化后,我访问位置管理器的唯一位置是在代理中,我在其中获取当前位置: - (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray*)locations { } 当应用程序启动时,代理将通过 - (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuth
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray*)locations
{
}
当应用程序启动时,代理将通过
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status
具有kCLAuthorizationStatusAuthorized。都很好
然后这被称为:
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{
NSLog(@"%@", error) ;
return ;
}
给出错误:
Error Domain=kCLErrorDomain Code=0 "The operation couldn’t be completed. (kCLErrorDomain error 0.)
在那之后,一切都如我所料。地点进来没有问题。这个错误似乎并不表明存在真正的问题
是否有人知道1)是否有某种方法可以避免启动时出现此错误,2)是否有某种方法可以让我区分此明显无意义的错误和我应该注意的错误?您的错误只有在模拟器中才会出现,对吗:) 如果在iPhone上尝试应用程序,则不会显示错误
如果要解决模拟器中的错误,每次启动应用程序时,在模拟器应用程序的菜单中选择一个位置~>Debug~>location,我在一台设备上,特别是第5代iPod上,发现了这个错误,因此它不是模拟器独有的。