CKError localizedDescription

牧云@^-^@ 提交于 2019-12-01 17:42:31

Looks like there is another error in the errorUserInfo[NSUnderlyingError]. Try getting the localizedDescription from that error.

So, that would be:

((error as? CKError)?.errorUserInfo[NSUnderlyingErrorKey] as? NSError)?.localizedDescription

The error.localizedDescription is really all you have to work with from the error itself.

Your app can provide a better error message (more user-friendly, localized, etc.) by checking for the error code and providing its own message to the user.

(error as? NSError)?.code
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!