Get iPhone's contacts list in Objective-C -


i'd iphone's contacts list without using ios navigation picker. here's code wrote...but it's not working, know why?

abaddressbookref addressbook = abaddressbookcreatewithoptions(null, null); cfarrayref allpeopleref = abaddressbookcopyarrayofallpeopleinsourcewithsortordering(addressbook, nil, kabpersonsortbyfirstname); cfindex npeople = abaddressbookgetpersoncount(addressbook);  for(int i=0; i<npeople; i++){     abrecordref ref = cfarraygetvalueatindex(allpeopleref, );     cfstringref tmpstringref = abrecordcopyvalue(ref, kabpersonfirstnameproperty);     nslog(@"firstname: %@", (__bridge nsstring *)tmpstringref);     cfrelease(tmpstringref); }  cfrelease(allpeopleref); cfrelease(addressbook); 


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -