- (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/