打开按钮上的所有联系人单击ios xcode [英] open all contacts on button click in ios xcode
本文介绍了打开按钮上的所有联系人单击ios xcode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想打开Apple的内置联系人按钮点击。我尝试了其他一些代码,但它没有用我在我的项目中添加了4个库
请提前帮助我解决方法
解决方案
很抱歉,但我得到的解决方案就在这里。
请尝试使用此代码打开默认联系人列表并进行管理此列表由其委托方法:
ABPeoplePickerNavigationController * picker =
[[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
picker.predicateForEnablingPerson = [NSPredicate predicateWithFormat:@%K。@ count> 0,ABPersonPhoneNumbersProperty];
[self.navigationController presentViewController:picker animated:YES completion:nil];
不要忘记在你查看控制器中导入地址簿框架及其代表。
#import< AddressBookUI / AddressBookUI.h>
#import< AddressBook / AddressBook.h>
代表:
ABPeoplePickerNavigationControllerDelegate
I Want To Open Apple's Inbuilt Contact Book On Button Click. I Have Tried Some Other Codes, But It Didn't Works I Have Added 4 Libraries In My Project
Please Help Me Out Thanx in Advance
解决方案
It's Sorry To Say But I Got Solution and It's Here.
Please try this code to open default contact list and manage this list by its delegate methods:
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init]; picker.peoplePickerDelegate = self; picker.predicateForEnablingPerson = [NSPredicate predicateWithFormat:@"%K.@count > 0", ABPersonPhoneNumbersProperty]; [self.navigationController presentViewController:picker animated:YES completion:nil];
And don't forget to import addressbook frameworks and its delegates in you view controller.
#import <AddressBookUI/AddressBookUI.h> #import <AddressBook/AddressBook.h>
Delegate :
ABPeoplePickerNavigationControllerDelegate
这篇关于打开按钮上的所有联系人单击ios xcode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文