如何在显示ABPeoplePickerNavigationController时指定组 [英] How to specify a group when displaying an ABPeoplePickerNavigationController

查看:186
本文介绍了如何在显示ABPeoplePickerNavigationController时指定组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在最初显示 ABPeoplePickerNavigationController 时指定一个组(因此它不会自动显示所有联系人)?

How do you specify a group when initially displaying an ABPeoplePickerNavigationController (so it doesn't automatically display "All Contacts")?

推荐答案

是的,我知道。我必须让它工作。

Yeah, I do. I had to make it work.

将您的班级设置为人员选择器的代表(pp.delegate = self;)

Set your class as the delegate of the people picker (pp.delegate = self;)

然后实现:

- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    if([navigationController.viewControllers count] > 1) {
        navigationController.delegate = nil;
        [navigationController popViewControllerAnimated:NO];
    }
}

关闭动画似乎效果最好,但仍然与它合作但有点傻。仅在模拟器上测试。

It seems to work best with animation off, but still works with it on but sort of goofy. Only tested on simulator.

D

这篇关于如何在显示ABPeoplePickerNavigationController时指定组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆