I try to parse a vcf-file. I use CNContact for this. That works quite well, but with the phonenumbers i have a problem.
With CNLabeledValue<CNPhoneNumber*>*
I get the label (e. g. "home") and the phonenumber in the value.
Excerpt from the vCard:
TEL;TYPE=home:1234567890
But if the number is tagged with a "pref" i can't get this tag for the phonenumber.
Excerpt from the vCard:
TEL;TYPE=home,pref:0987654321
Is there anyway to find out, which numbers are the preferred numbers?
I use following code:
for (CNLabeledValue<CNPhoneNumber*>* number in cnContact.phoneNumbers) { NSString *label = number.label; NSString *number = ((CNPhoneNumber*)number).stringValue; //Do some work with label and number }