CNUI错误联系人视图延迟外观超时 [英] CNUI ERROR Contact view delayed appearance timed out

查看:98
本文介绍了CNUI错误联系人视图延迟外观超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用iOS 10中的ContactsUI框架显示Contacts添加新的联系人视图. 我用来呈现CNContactViewController的代码如下:

I am trying to show the Contacts add new contact view with the ContactsUI framework in iOS 10. The code that I am using to present CNContactViewController the is the following:

    let contactViewController = CNContactViewController(forNewContact: contact)
    contactViewController.contactStore = CNContactStore()
    contactViewController.delegate = self

    self.present(contactViewController, animated: false) {}

但是,每次执行代码时,应用都会冻结,并且出现以下错误日志的次数是三倍以上: [CNUI错误]联系人视图延迟显示超时

But every time I execute the code the app gets frozen and I get three + times the following error log: [CNUI ERROR] Contact view delayed appearance timed out

欢迎任何解释,

推荐答案

我找到了一种解决方法.只需将CNContactViewController包裹在UINavigationController中,一切都会好起来的.

I find a workaround. Just wrap your CNContactViewController in UINavigationController and all will be fine.

@JackRobson的特殊代码示例

Special code sample for @JackRobson

let contactViewController = CNContactViewController(forNewContact: contact)
contactViewController.contactStore = CNContactStore()
contactViewController.delegate = self
let navigationController = UINavigationController(rootViewController: contactViewController)
self.present(navigationController, animated: false) {}

这篇关于CNUI错误联系人视图延迟外观超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆