gpt4 book ai didi

ios - 可以从我的应用程序iOS 7中打开“联系人”应用程序

转载 作者:行者123 更新时间:2023-12-01 17:12:45 25 4
gpt4 key购买 nike

我想知道是否可以从我的应用程序iOS 7中打开通讯录应用程序。
我将向用户解释,我希望为用户提供以下选项:搜索联系人,然后单击联系人以将其重定向到具有所选联系人特定页面的联系人应用程序
有可能吗
提醒和日历事件也可能这样做吗?

最佳答案

有可能,这是一个示例:

.h文件:

@interface PickViewController : UIViewController <ABPeoplePickerNavigationControllerDelegate, UINavigationControllerDelegate>
@property (strong, nonatomic) ABPeoplePickerNavigationController *peoplePicker;
@end

.m文件:
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
_peoplePicker = [[ABPeoplePickerNavigationController alloc] init];
_peoplePicker.delegate = self;
}

- (IBAction)btnAdd:(id)sender
{
[self presentViewController:self.peoplePicker animated:YES completion:nil];
}

#pragma mark - ABPeoplePickerNavigationController Delegate

- (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker
{
[self dismissViewControllerAnimated:YES completion:NULL];
}

- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person
{
NSString* name = (__bridge_transfer NSString*)ABRecordCopyValue(person, kABPersonFirstNameProperty);
NSLog(@"Name %@", name);
return NO;
}

- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
{
return YES;
}

关于ios - 可以从我的应用程序iOS 7中打开“联系人”应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22065465/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com