I am trying to get the phone numbers from an ABRecord object, and it is currently not working. Here is the code I am trying
ABRecord *record = contactsArr[row];
NSString *home;
NSString *iPhone;
NSString *main;
NSString *work;
NSString *mobile;
ABMutableMultiValue *multiValue = [record valueForProperty:kABPhoneProperty];
ABMutableMultiValue *multiValue2 = [record valueForProperty:kABPhoneHomeLabel];
ABMutableMultiValue *multiValue3 = [record valueForProperty:kABPhoneiPhoneLabel];
ABMutableMultiValue *multiValue4 = [record valueForProperty:kABPhoneMainLabel];
ABMutableMultiValue *multiValue5 = [record valueForProperty:kABPhoneMobileLabel];
ABMutableMultiValue *multiValue6 = [record valueForProperty:kABPhoneWorkLabel];
if ([multiValue valueAtIndex:0]) {
numberString = [multiValue valueAtIndex:0];
}
if ([multiValue3 valueAtIndex:0]) {
iPhone = [multiValue valueAtIndex:0];
}
These are the errors I am getting in the output.
[7260:278597] -[ABPerson valueForProperty:_$!<Home>!$_] - unknown property. This warning will be displayed only once per unknown property, per session.
[7260:278597] -[ABPerson valueForProperty:iPhone] - unknown property. This warning will be displayed only once per unknown property, per session.
[7260:278597] -[ABPerson valueForProperty:_$!<Main>!$_] - unknown property. This warning d[7260:278597] -[ABPerson valueForProperty:_$!<Mobile>!$_] - unknown property. This warning will be displayed only once per unknown property, per session.
[7260:278597] -[ABPerson valueForProperty:_$!<Work>!$_] - unknown property. This warning will be displayed only once per unknown property, per session.
What is the correct way of getting the phone numbers for each type of phone record from an ABRecord/Person? I can currently get it from the regular phone number but not from the specifics.