Ios 如何将联系人导入我的应用程序
我需要在我的应用程序中访问iPhone的联系人 我使用的是Xcode 7.2和IOS-9。 给我一个对我有用的最好的框架或库 我尝试使用ABAddressbook框架,但它已被弃用 谢谢。Ios 如何将联系人导入我的应用程序,ios,objective-c,cocoa-touch,contacts,Ios,Objective C,Cocoa Touch,Contacts,我需要在我的应用程序中访问iPhone的联系人 我使用的是Xcode 7.2和IOS-9。 给我一个对我有用的最好的框架或库 我尝试使用ABAddressbook框架,但它已被弃用 谢谢。 CNContactPickerViewController 通讯簿用户界面框架 MFMessageComposeViewController 教程 苹果公司推出了新的框架Contacts和ContactsUI,用于访问iOS9及以上版本的联系人 以前的ABAddressbook框架已被弃用。你可
- CNContactPickerViewController
- 通讯簿用户界面框架
- MFMessageComposeViewController
- 教程
- (void) presentContacts
{
CNContactPickerViewController *contactPicker = [[CNContactPickerViewController alloc] init];
contactPicker.delegate = self;
[_myViewController presentViewController:contactPicker animated:YES completion:nil];
}
//Listen for delegates
- (void) contactPickerDidCancel: (CNContactPickerViewController *) picker
{
NSLog(@"didCancel");
}
- (void) contactPicker: (CNContactPickerViewController *) picker
didSelectContact: (CNContact *) contact
{
NSLog(@"didSelectContact"):
}
- (void) contactPicker: (CNContactPickerViewController *) picker
didSelectContactProperty: (CNContactProperty *) contactProperty
{
NSLog(@"didSelectProperty");
}
您可以使用Contacts和Contacts UI框架,而不是ABAddressbook框架。请在中阅读不推荐使用的API。