I want to check if a contact in my user's addressbook a phone number has. If he does, I want to display that name in an UITableView
I've tried to check for phoneNumbers != nil
, but that doesn't work. This is my entire code:
ABMultiValueRef phoneNumbers = ABRecordCopyValue(person, kABPersonPhoneProperty);
if(phoneNumbers != nil){
[_numbers addObject:[NSString stringWithFormat:@"%@", phoneNumbers]];
}
Use
ABMultiValueGetCount
to check if phoneNumbers has any values in it.example based on question: