5

I have a weird problem and I hope this is Apple's bug. let me know if this is a Apple bug.

Steps

  • Open Dialer
  • Dial a number and add to contacts using + sign as number1
  • Open contacts and add number2 to contacts using contacts app

Now the below code returns

    for (CNLabeledValue *labelObj in contact.phoneNumbers) {
    phone = [labelObj.value stringValue];
    CNLabeledValue *cnPhoneLabel = [CNLabeledValue labeledValueWithLabel:labelObj.label value:labelObj.value];
    NSString *phoneLabelString = [[CNLabeledValue localizedStringForLabel:cnPhoneLabel.label] capitalizedString];
    }

number1

    "<CNLabeledValue: 0x148306800: 
identifier=08C1A708-F5A2-4A65-AB08-024B3FCF79C4, label=(null), 
value=<CNPhoneNumber: 0x148297aa0: countryCode=in, digits=2586352952356>>"

number2

"<CNLabeledValue: 0x148296a60:
identifier=7D9ABC9E-D5AF-421D-BFF6-7902BC99E80F, label=_$!<Mobile>!$_,
value=<CNPhoneNumber: 0x148296aa0: countryCode=in, digits=7392>>"

number1 label returns label as null

NLabeledValue: 0x148306800: identifier=08C1A708-F5A2-4A65-AB08-024B3FCF79C4, label=(null)

Arvind
  • 493
  • 1
  • 8
  • 23
  • Issue still exist with iOS 12. the label displayed in Contact app is "phone" , but when we try to fetch using CNLabeledValue, then its empty – jpulikkottil Jul 12 '19 at 05:27

0 Answers0