Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/100.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何将联系人导入我的应用程序_Ios_Objective C_Cocoa Touch_Contacts - Fatal编程技术网

Ios 如何将联系人导入我的应用程序

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框架已被弃用。你可

我需要在我的应用程序中访问iPhone的联系人

我使用的是Xcode 7.2IOS-9。 给我一个对我有用的最好的框架或库

我尝试使用ABAddressbook框架,但它已被弃用

谢谢。

  • CNContactPickerViewController

  • 通讯簿用户界面框架

  • MFMessageComposeViewController

  • 教程


苹果公司推出了新的框架Contacts和ContactsUI,用于访问iOS9及以上版本的联系人

以前的ABAddressbook框架已被弃用。你可能会在这里面找到很多信息

您可以为iOS9+设备使用框架

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