CNUI ERROR 联系人视图延迟出现超时
CNUI ERROR Contact view delayed appearance timed out
我正在尝试使用 iOS 10 中的 ContactsUI 框架显示联系人添加新联系人视图。
我用来呈现 CNContactViewController 的代码如下:
let contactViewController = CNContactViewController(forNewContact: contact)
contactViewController.contactStore = CNContactStore()
contactViewController.delegate = self
self.present(contactViewController, animated: false) {}
但每次我执行代码时,应用程序都会冻结,并且我会收到以下错误日志的三倍以上:
[CNUI ERROR] 联系人视图延迟显示超时
欢迎任何解释,
我找到了解决方法。只需将 CNContactViewController
包裹在 UINavigationController
中,一切都会好起来的。
@JackRobson 的特殊代码示例
let contactViewController = CNContactViewController(forNewContact: contact)
contactViewController.contactStore = CNContactStore()
contactViewController.delegate = self
let navigationController = UINavigationController(rootViewController: contactViewController)
self.present(navigationController, animated: false) {}
我正在尝试使用 iOS 10 中的 ContactsUI 框架显示联系人添加新联系人视图。 我用来呈现 CNContactViewController 的代码如下:
let contactViewController = CNContactViewController(forNewContact: contact)
contactViewController.contactStore = CNContactStore()
contactViewController.delegate = self
self.present(contactViewController, animated: false) {}
但每次我执行代码时,应用程序都会冻结,并且我会收到以下错误日志的三倍以上: [CNUI ERROR] 联系人视图延迟显示超时
欢迎任何解释,
我找到了解决方法。只需将 CNContactViewController
包裹在 UINavigationController
中,一切都会好起来的。
@JackRobson 的特殊代码示例
let contactViewController = CNContactViewController(forNewContact: contact)
contactViewController.contactStore = CNContactStore()
contactViewController.delegate = self
let navigationController = UINavigationController(rootViewController: contactViewController)
self.present(navigationController, animated: false) {}