呈现 ContactUI CNContactViewController 导致隐私错误和 CNUI 错误

Presenting ContactUI CNContactViewController results in a privacy error and a CNUI error

我尝试以编程方式为新联系人显示 CNContactViewController,但出现错误 "Access to PassKit Shared Cache file denied. Please verify sandbox exceptions and/or file a Radar." CNContactViewController 也没有显示。

我检查我是否拥有所有有效权限,例如 info.plist 中的隐私--联系人,并且我已经在我的代码中获得了权限。我有。

let cnContactViewController=CNContactViewController(forNewContact: contact)
vc.present(cnContactViewController, animated: true)

我希望应用程序显示 ContactsUI 的 CNContactViewController 并在其字段中填写联系人,但它没有发生,我收到两条错误消息: 拒绝访问 PassKit 共享缓存文件。请验证沙盒异常 and/or 文件雷达。 和 CNUI ERROR 联系人视图延迟出现超时

事实证明,第一个错误 "Access to PassKit Shared Cache file denied. Please verify sandbox exceptions and/or file a Radar" 与 CNContactViewController 未显示无关。为了解决它不呈现的问题,我使用@Andrew Vyazovoy 的 post 并将 CNContactViewController 作为导航控制器的根视图控制器并呈现导航控制器,CNContactViewController 显示在屏幕上.隐私问题无关。

我遇到同样的错误,我使用以下代码修复了

let vc = CNContactViewController(forNewContact: contact)
vc.delegate = self
let navigationController: UINavigationController = UINavigationController(rootViewController: vc)
            present(navigationController, animated: false) {
                print("Present")
            }