NSInvalidArgumentException

NSInvalidArgumentException

本文介绍了异常'NSInvalidArgumentException'NSHealthUpdateUsageDescritption的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于未捕获的异常"NSInvalidArgumentException"而终止应用程序,原因:必须在应用程序的Info.plist中设置NSHealthUpdateUsageDescription才能请求写授权."

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSHealthUpdateUsageDescription must be set in the app's Info.plist in order to request write authorization.'

Info.plist具有此条目

Info.plist has this entry

<key>NSHealthShareUsageDescription</key>
<string>some string value stating the reason</string>

推荐答案

如果您已经添加了 NSHealthShareUsageDescription ,但仍收到异常.

If you already added NSHealthShareUsageDescription but still get the exception.

可能是因为说明太简短.

确保所有语言环境的说明都超过12个字符.

Make sure the description is longer than 12 characters for all locales.

例如

HelloHello->崩溃!

HelloHello -> Crash!!

HelloHelloHi->确定

HelloHelloHi -> OK

这篇关于异常'NSInvalidArgumentException'NSHealthUpdateUsageDescritption的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 20:20