HOW TO CONVERT RETURN VALUE OF ABMULIVALUECOPYLABELATINDEX INTO NSSTRING IN IOS

Chris S

Total Post:48

Points:336
Posted by  Chris S
 538  View(s)
Ratings:
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?
  1. Tarun Kumar

    Post:214

    Points:1642
    Re: How to convert return value of ABMuliValueCopyLabelAtIndex into NSString in iOS

    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));

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!