ios - ABMultiValueCopyLabelAtIndex returns null, but the label is visible in the address book -



ios - ABMultiValueCopyLabelAtIndex returns null, but the label is visible in the address book -

i'm trying read label of particular instant message service in address book. in case i'm testing facebook messenger service, on phone. contact has linked contacts, 1 recorded instant message service.

i tried find info on how abmultivaluecopylabelatindex works, found "may homecoming null". if there's no visible label in address book yeah, understand why homecoming null. in case there label, , reads "facebook messenger" in person view. still null, why?

- (bool)personviewcontroller:(abpersonviewcontroller *)personviewcontroller shouldperformdefaultactionforperson:(abrecordref)personrecord property:(abpropertyid)property identifier:(abmultivalueidentifier)identifierforvalue { // im services: abmultivalueref instantmessageproperty = abrecordcopyvalue(personrecord, property); // 1 particular im service: cfdictionaryref instantmessagedict = abmultivaluecopyvalueatindex(instantmessageproperty, abmultivaluegetindexforidentifier(instantmessageproperty, identifierforvalue)); // name: nsstring *servicename = (__bridge nsstring*)cfdictionarygetvalue(instantmessagedict, kabpersoninstantmessageservicekey); // label: nsstring *servicelabel = (__bridge_transfer nsstring*)abmultivaluecopylabelatindex(instantmessageproperty, abmultivaluegetindexforidentifier(instantmessageproperty, identifierforvalue)); nslog(servicename); // logs "facebook", things seem work nslog(servicelabel); // logs nothing, , confirmed servicelabel == nil [...] }

ios abaddressbook abmultivalue

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -