【发布时间】:2017-02-03 08:29:41
【问题描述】:
我在应用商店中有一个使用 Touch ID 的 iPhone 应用。如果启用了 Touch ID,则用户通过它进行身份验证,否则用户需要输入其 PIN 才能登录应用程序。
IOS 10.1 发布后,当我查看崩溃报告时,崩溃计数增加了。从崩溃报告中,它指向[UIApplication _cachedSystemAnimationFenceCreatingIfNecessary:],当我在Xcode中打开应用程序时,它集中在[self dismissViewControllerAnimated:YES completion:nil];。
我写的代码如下:
-(void) showTouchIDAuthentication{
LAContext *myContext = [[LAContext alloc] init];
NSError *authError = nil;
NSString *myLocalizedReasonString = @"Authenticate using your finger to access My Account Menu.";
if ([myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError]) {
[myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
localizedReason:myLocalizedReasonString
reply:^(BOOL success, NSError *error) {
if (success) {
NSLog(@"User is authenticated successfully");
[self dismissViewControllerAnimated:YES completion:nil];
} else {
}];
}
}
当我在 iPhone 6、IOS 10 中进行测试时,一切正常。不知道如何模拟问题。
谁能帮我弄清楚我是否遗漏了什么?请帮我解决这个崩溃问题。
【问题讨论】:
标签: iphone uiviewcontroller objective-c-blocks touch-id