gpt4 book ai didi

iOS8 Touch ID 获取错误 : Pending UI mechanism already set

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:16:41 24 4
gpt4 key购买 nike

错误描述如下:

Error Domain=com.apple.LocalAuthentication Code=-1000 "Pending UI mechanism already set." UserInfo=0x17406b0c0 {NSLocalizedDescription=Pending UI mechanism already set.}

我也在尝试 Apple 的 Sample Example 应用程序并遇到同样的错误。以前它工作正常,但它突然停止工作并且不工作。请帮忙。

我正在使用装有 iOS 8.1 的 iPhone 6

最佳答案

这段代码对我来说效果很好。

LAContext *myContext = [[LAContext alloc] init];
NSError *authError = nil;
NSString *myLocalizedReasonString = @"String explaining why app needs authentication";

if ([myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError]) {
[myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
localizedReason:myLocalizedReasonString
reply:^(BOOL success, NSError *error) {
if (success) {
// User authenticated successfully, take appropriate action
NSLog(@"User authenticated successfully, take appropriate action");
} else {
// User did not authenticate successfully, look at error and take appropriate action
NSLog(@"User did not authenticate successfully, look at error and take appropriate action");
}
}];
} else {
// Could not evaluate policy; look at authError and present an appropriate message to user
NSLog(@"Could not evaluate policy: %@",authError);
}

不要忘记导入本地身份验证框架 <LocalAuthentication/LAContext.h>.希望这会解决您的问题。

关于iOS8 Touch ID 获取错误 : Pending UI mechanism already set,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27436139/

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