CNContact add new contact issue

旧时模样 提交于 2019-12-06 09:43:40

问题


I'm faccing an issue at time of adding contacts throught Contact Framework.

I used device iPhone 5s with iOS 12.1.2

My Code for adding contact is as below ::

let saveRequest = CNSaveRequest()
saveRequest.add(self, toContainerWithIdentifier: nil)
do {
    try contactStore.execute(saveRequest)
} catch let error {
    print("Error occurred while saving the request \(error)")
}

This everytime thows error as below ::

Error occurred while saving the request Error Domain=CNErrorDomain Code=1 "Communication Error" UserInfo={NSLocalizedDescription=Communication Error, NSLocalizedFailureReason=An error occurred while trying to communicate with the Contacts service.}

Dose any one now anything about this error?

I'm not able to found any thing about this.

来源:https://stackoverflow.com/questions/54326775/cncontact-add-new-contact-issue

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