通讯录能删除吗?怎么删除?现在找的资料都是怎么获取通讯录数据! |
|
40分 |
-(void)editar:(id)sender { ABAddressBookRef libroDirec = ABAddressBookCreate(); CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople(libroDirec); CFIndex xPeople = ABAddressBookGetPersonCount(libroDirec); for (int i=0; i <xPeople; i++ ) { ABRecordRef ref = CFArrayGetValueAtIndex(allPeople, i); CFStringRef nombreX = ABRecordCopyValue(ref, kABPersonFirstNameProperty); CFStringRef cadena = CFSTR("kate"); if (CFStringCompare(nombreX, cadena , 0) == kCFCompareEqualTo ) { ABAddressBookRemoveRecord(libroDirec, ref, nil); ABAddressBookSave(libroDirec, nil); } } } 其他相关资料请参考我的博客文章 |