【发布时间】:2016-04-14 15:48:02
【问题描述】:
我正在尝试删除通讯录中的联系人,但出现以下错误。
这是我的实现:
CNMutableContact *contact = [[cnContacts objectAtIndex:i] copy];
[cnContacts removeObjectAtIndex:i];
CNSaveRequest *request = [[CNSaveRequest alloc] init];
[request deleteContact:contact];
NSError *error;
if (![self.ContactStore executeSaveRequest:request error:&error]) {
if (error)
{
NSLog(@"error = %@", error.description);
}
}
在这一行:
if (![self.ContactStore executeSaveRequest:request error:&error]) {
我在控制台中收到此错误:
-[CNContact setSnapshot:]:无法识别的选择器发送到实例 0x145de3940
这个错误也显示出来了:
Contacts`-[CNDataMapperContactStore executeSaveRequest:error:]:
libdispatch.dylib`_dispatch_mgr_thread:
你们中的任何人都知道为什么会出现此错误或我在实施中做错了什么。
【问题讨论】:
标签: ios contacts abaddressbook