iOS - iOS 上的以下 LAContext 错误日志是啥意思?

Posted

技术标签:

【中文标题】iOS - iOS 上的以下 LAContext 错误日志是啥意思?【英文标题】:iOS - What does the following LAContext error logs on iOS mean?iOS - iOS 上的以下 LAContext 错误日志是什么意思? 【发布时间】:2021-07-06 15:35:19 【问题描述】:

我在控制台中不断收到以下日志。

[Client,LAContext] LAContext[5174:1692] will keep returning Error Domain=com.apple.LocalAuthentication Code=-10 "Invalidated due to exceeded number of allocated contexts." UserInfo=NSLocalizedDescription=Invalidated due to exceeded number of allocated contexts. from now on.

有人可以帮忙吗?这是什么产生的?

【问题讨论】:

【参考方案1】:

听起来您正在创建多个 LAContext 对象,根据我自己在 12 Pro Sim 上的测试,此错误发生在您有 65 个尚未失效的 LAContext 之后。

LAContext 在发布时应该会自动失效。也许您在 ViewController 中实例化它并且您的 ViewController 有一个保留周期,阻止 LAContext 被释放?

您可以通过在实例上调用invalidate() 手动使LAContext 无效。

【讨论】:

以上是关于iOS - iOS 上的以下 LAContext 错误日志是啥意思?的主要内容,如果未能解决你的问题,请参考以下文章

iOS指纹识别

IOS 指纹识别的简单使用

使用 LAContext 和 touchIDAuthenticationAllowableReuseDuration 获取钥匙串项

在 IOS7 中不可见 AlertView 上的选择器

iOS9 上的 UIAlertController ActionSheet 问题

IOS9 上的 Worklight Hybrid 应用程序后退按钮问题