在选项卡视图中加载的地址簿

发布于 2024-08-11 03:10:24 字数 652 浏览 4 评论 0原文

我有一个我认为很简单的任务。

我有一个示例项目,它允许用户单击按钮在视图中调出 AddressBook 用户界面。据我所知,大部分工作都是在这里完成的:

-(IBAction) checkOutBookid)sender
{
ABPeoplePickerNavigationController *peoplePicker=[[ABPeoplePickerNavigationController alloc] init];

[peoplePicker setPeoplePickerDelegate:self];

[self.navigationController presentModalViewControllereoplePicker animated:YES];
[peoplePicker release];
}

并且视图上有一个按钮,其中 TouchUp Inside 链接到此操作。现在,我不需要单击按钮,而是想要一个已加载 AddressBook 的视图。我尝试将上面的代码( {} 之间的所有内容)放入 ViewController 的 didLoad 事件中。不,那不起作用。我导入了AB框架。我没有收到任何错误,只是视图加载时没有任何内容。

我缺少什么?

I have what I thought would be a simple task.

I have a sample project that will let a user click a button to pull up the AddressBook user interface within a view. From what I see most of the work is done here:

-(IBAction) checkOutBookid)sender
{
ABPeoplePickerNavigationController *peoplePicker=[[ABPeoplePickerNavigationController alloc] init];

[peoplePicker setPeoplePickerDelegate:self];

[self.navigationController presentModalViewControllereoplePicker animated:YES];
[peoplePicker release];
}

And there is a button on a view has TouchUp Inside linked to this action. Now, instead of clicking a button, I want a view to just have the AddressBook already loaded. I tried putting the code above (everything between the {} ) in the ViewController's didLoad event. Nope, that didn't work. I have the AB frameworks imported. I don't get any errors, it's just the view loads with nothing in it.

What am I missing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清眉祭 2024-08-18 03:10:24

这似乎有效:

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];

    ABPeoplePickerNavigationController *peoplePicker=[[ABPeoplePickerNavigationController alloc] init];

    [peoplePicker setPeoplePickerDelegate:self];

    [self presentModalViewController:peoplePicker animated:YES];
    [peoplePicker release];
}

This seems to work:

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];

    ABPeoplePickerNavigationController *peoplePicker=[[ABPeoplePickerNavigationController alloc] init];

    [peoplePicker setPeoplePickerDelegate:self];

    [self presentModalViewController:peoplePicker animated:YES];
    [peoplePicker release];
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文