从应用程序访问iPhone联系人

时间:2013-01-03 15:50:44

标签: iphone ios xcode

我是一名新的ios程序员,在我的应用程序上,我想访问我的联系人以进行通话。你们有任何练习文件或教程。我看起来像是在Viber应用程序上。当用户点击联系人时,可以打电话,对不起我的英文不好。

谢谢。

1 个答案:

答案 0 :(得分:4)

要显示联系人列表,您可以使用以下代码:

ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
[self presentViewController: picker animated:YES completion: nil];

你可以使用

- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier

从联系人中选择电话号码时执行必要的操作。

如需快速入门,请查看AddressBookProgrammingGuideforiPhone