Home > DeveloperSection > Forums > How to convert return value of ABMuliValueCopyLabelAtIndex into NSString in iOS
Chris S
Chris S

Total Post:48

Posted on    December-02-2015 7:29 AM

 iPhone iPhone  Ios  Objective C 

 1 Reply(s)
 502  View(s)
Rate this:
I have a problem in with my contact type in iOS, I have successfully fetch phone number type like work, mobile, home, etc. using this code:
NSString *cellT = (__bridge NSString*) ABMultiValueCopyLabelAtIndex(numbersArr, j);
NSLog(@"Contact Type: %@", cellT);
this code will print:

But I want only Work to display, how can I do this?

Tarun Kumar

Total Post:214

Posted on    December-05-2015 7:32 AM

Use this ABAddressBookCopyLocalizedLabel  at the time of type casting; to ignore _ $ !  these type of   unnecessary scientific characters:

change your code by this code:
NSString *cellT = (__bridge NSString*) ABAddressBookCopyLocalizedLabel ABMultiValueCopyLabelAtIndex(numbersArr, j));

Don't want to miss updates? Please click the below button!

Follow MindStick