Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to import contact list from iphone address book to my application?

- (void)viewDidLoad {
    [super viewDidLoad];

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.

    UIBarButtonItem *btn = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"2.png"] style:UIBarButtonItemStyleBordered target:self action:nil];
    self.navigationItem.rightBarButtonItem = btn;

    self.navigationItem.title = @"Contacts";

    sBar = [[UISearchBar alloc]initWithFrame:CGRectMake(0,0,320,30)];
    sBar.delegate = self;

    [self.view addSubview:sBar];
    sBar.placeholder=@"Search";


    searchedData = [[NSMutableArray alloc]init];

    tableData = [[NSMutableArray alloc]init];

    [tableData addObjectsFromArray:dataSource]; 
}
like image 988
Furqi Avatar asked Nov 14 '22 21:11

Furqi


1 Answers

The following Quick Start guide from Apple's iOS docs could get you started on this.

Address Book Programming Guide for iPhone - QuickStart

It shows you how to import the AddressBookUI/AddressBookUI.h headers and open a native people picker, as well as listen for when a person is picked.

like image 88
Shankar Aware Avatar answered Dec 21 '22 06:12

Shankar Aware