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

Total Post:48

Points:336
Posted on    December-02-2015 7:29 AM

 iPhone iPhone  Ios  Objective C 
Ratings:


 1 Reply(s)
 334  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:
_$!<Work>!$_

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


Tarun Kumar

Total Post:210

Points:1614
Supported
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