如何从ios中的通讯录中仅获取移动部分记录?
我只想将一条记录添加到我的数组中,该记录是从移动部分记录中获取的。
我怎么做。我正在获取所有电话财产记录。但我只需要获取移动部分记录。
NSArray *allPeople = (NSArray *)ABAddressBookCopyArrayOfAllPeople(myAddressBook);
NSLog(@"allpeople%@", allPeople);
for (id record in allPeople) {
CFTypeRef phoneProperty = ABRecordCopyValue((ABRecordRef)record, kABPersonPhoneProperty);
NSArray *phones = (NSArray *)ABMultiValueCopyArrayOfAllValues(phoneProperty);
NSLog(@"phones %@",phones);
CFRelease(phoneProperty);
NSMutableDictionary *newRecord = [[NSMutableDictionary alloc] init];
NSMutableString *newPhone = [[NSMutableString alloc] init];
for (NSString *phone in phones) {
if(![newPhone isEqualToString:@""])
[newPhone appendString:@", "];
[newPhone appendString:phone];
}