Official address: Https://github.com/heardrwt/RHAddressBook
1. Installation configuration: http://rheard.com/blog/using-static-ios-libraries/
Main steps
Http://rheard.com/skitch/UsingStaticLibraries1-20121104-223027.png
Http://rheard.com/skitch/UsingStaticLibraries2-20121104-223532.png
Http://rheard.com/skitch/UsingStaticLibraries4-20121104-224413.png
On the code:
////VIEWCONTROLLER.M#import "ViewController.h"#import<RHAddressBook/AddressBook.h>@interfaceViewcontroller ()@end@implementationViewcontroller- (void) viewdidload {[Super viewdidload];}- (void) Touchesbegan: (Nsset *) touches withevent: (Uievent *)Event{ //1. Get Authorization statusRhauthorizationstatus status =[Rhaddressbook Authorizationstatus]; //2. Determine if it is not authorized, return directly if(Status! = rhauthorizationstatusauthorized)return; //3. Create a Correspondence recordRhaddressbook *addressbook =[[Rhaddressbook alloc] init]; //4. Get all the contactsNsarray *peoplearray =addressbook.people; //5. Traverse all the Contacts for(Rhperson *personinchPeoplearray) { //6. Get the name of the contact personNSLog (@"%@ %@", Person.firstname, person.lastname); //7. Get the phone numberRhmultivalue *phones =person.phonenumbers; for(inti =0; i < Phones.count; i++) { //8. Get the phone number and the corresponding labelNSString *phonelabel =[Phones labelatindex:i]; NSString*phonevalue =[Phones valueatindex:i]; NSLog (@"%@ %@", Phonelabel, Phonevalue); } }}@end
Use a third-party framework Rhaddressbook to obtain a communication record