iphone - 如何将联系人列表从 iPhone 通讯录导入到我的应用程序?

标签 iphone contact-list

- (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]; 
}

最佳答案

以下 Apple iOS 文档中的快速入门指南可以帮助您开始此操作。

Address Book Programming Guide for iPhone - QuickStart

它向您展示了如何导入 AddressBookUI/AddressBookUI.h header 并打开 native 人员选择器,以及监听何时选择人员。

关于iphone - 如何将联系人列表从 iPhone 通讯录导入到我的应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6504496/

相关文章:

iphone - 通过 SMS OTA 发送 .mobileconfig 文件

android - 获取联系号码并将其存储为电话簿中的变量

javascript - 如何使用 iPhone 中的邮件编辑器插件使用电话间隙 jQuery mobile 发送电子邮件

iphone - Objective C - 隐藏 iVar

c++ - 从 C++ 访问 objective-c

iphone - 如何在 objective-c 中实现sqlite3_trace回调

php - 有没有好的方法(PHP 类)来访问 Gmail 联系人?

java - 如何使用 sdk 27​​ 在 android studio 中显示联系人电话列表

ios - 更改文本颜色 UINavigationBar