作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我试图通过带有有效EKEvent
实例的EKEventEditViewController
创建EKEventStore
(用户已授予日历和事件的权限)。
每次我点击以添加“受邀者”时,“受邀者”搜索对话框都会打开以进行搜索,并且在键入搜索时,UI冻结(与正常运行的本机“日历”应用相比),出现以下错误:
Error Domain=SGErrorDomain Code=8 "(null)" for fetching in store:
<CNSuggestedContactStore: 0x151ffa9b0> with predicate: <CNiOSABContactIdentifiersPredicate:
0x1521768f0: kind=-[CNContact predicateForContactsWithIdentifiers:],
identifiers=("A2AD81DE-73C9-4AFB-99DC-FA491B7C2706:ABPerson)>"
Error Domain=SGErrorDomain Code=8 "(null)" for fetching in store:
<CNSuggestedContactStore: 0x151ffa9b0> with predicate: <CNiOSABContactIdentifiersPredicate:
0x152158910: kind=-[CNContact predicateForContactsWithIdentifiers:],
identifiers=("6905A79B-001E-448E-93C2-C7460FEAAF78)>"
最佳答案
我尝试了几种不同的方法。最终可行的是请求访问用户联系人。我相信是因为日历正在从您的应用程序内访问用户联系人。
添加NSContactsUsageDescription
https://developer.apple.com/documentation/contacts#1773385
关于ios - 添加被邀请者时,EKEventEditViewController SGErrorDomain代码= 8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34083903/
我是一名优秀的程序员,十分优秀!