gpt4 book ai didi

iphone - 如何处理位置管理器的“"Don' t允许”?

转载 作者:行者123 更新时间:2023-12-03 18:21:21 24 4
gpt4 key购买 nike

我现在还没有想到这一点。

到目前为止,每当设备要求我使用位置更新时,我都会允许。

但是现在我不允许,那么位置管理器会给我 kclErrorDenied 并且位置管理器无法再次启动,直到我重新启动应用程序。

所以我的问题是,我应该向用户发送重新启动应用程序的消息,还是有解决方案来重新开始使用位置管理器。

谢谢。

The Error :
ERROR,Time,288787555.078,Function,"void CLClientHandleDaemonDataRegistration(__CLClient*, const CLDaemonCommToClientRegistration*, const __CFDictionary*)",server did not accept client registration 1
WARNING,Time,288787555.108,Function,"void CLClientHandleDaemonInvalidation(__CFMessagePort*, void*)",client 1308.0 has been disconnected from daemon
locationManager:didFailWithError:] [Line 244] Error Denied :Error Domain=kCLErrorDomain Code=1 "Operation could not be completed. (kCLErrorDomain error 1.)"

最佳答案

实现- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
NSMutableString *errorString = [[[NSMutableString alloc] init] autorelease];

if ([error domain] == kCLErrorDomain) {

// We handle CoreLocation-related errors here
switch ([error code]) {
// "Don't Allow" on two successive app launches is the same as saying "never allow". The user
// can reset this for all apps by going to Settings > General > Reset > Reset Location Warnings.
case kCLErrorDenied:
//...
break;
case kCLErrorLocationUnknown:
//...
break;
default:
//...
break;
}
} else {
// We handle all non-CoreLocation errors here
}
}

关于iphone - 如何处理位置管理器的“"Don' t允许”?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2333344/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com