重新加载/刷新 ABPersonViewController

发布于 2024-09-28 15:28:11 字数 514 浏览 0 评论 0原文

在我的应用程序中,用户可以查看和编辑他们的通讯簿联系人。现在,我正在尝试支持 iOS 4 后台。

这是我的问题。如果用户正在查看联系人,在我的应用程序中说“John Appleseed”,则用户可以切换到 iPhone 通讯簿,打开“John Appleseed”,然后更改他的联系信息。如果用户随后切换回我的应用程序,则我的应用程序中的 John Appleseed 视图现已过时。我希望此视图能够使用新信息进行刷新。显然,用户可以在应用程序内关闭并重新打开联系人(或者应用程序可以通过编程方式执行此操作),但这并不是理想的用户体验。

我知道这也是可能的,即用户在应用程序内编辑联系人并切换到 iPhone 地址簿并查看自动更新。

我已经知道如何检测是否发生了更改,但我希望能够刷新视图。我正在使用 ABPersonViewController。不幸的是,由于这不是 UITableViewController 的实例,我不能只执行 [self.tableView reloadData]

提前感谢您对这个问题的任何帮助!

In my app, users can view and edit their Address Book contacts. Right now, I'm trying to support iOS 4 backgrounding.

Here's my problem. If a user is viewing a contact, say "John Appleseed" in my app, the user can then switch to the iPhone Address Book, open "John Appleseed," and change his contact info. If the user then switches back to my app, my app's view of John Appleseed is now out of date. I want this view to refresh with the new info. Obviously, the user can close and reopen the contact in-app (or the app can do this programmatically), but this is a less than ideal user experience.

I know this is possible the other way around i.e. user edits contact in-app and switches to the iPhone Address Book and the view auto updates.

I already know how to detect if a change has happened, but I want to be able to refresh the view. I am using an ABPersonViewController. Unfortunately, since this isn't an instance of UITableViewController, I can't just do [self.tableView reloadData]

Thanks in advance for any help on the issue!

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

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

发布评论

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

评论(1

高跟鞋的旋律 2024-10-05 15:28:11

如果您已经知道如何获取新的联系信息作为 ABRecordRef,那么请尝试

yourABPersonViewController.displayedPerson = yourNewABRecordRef;
[yourABPersonViewController.view setNeedsDisplay];

If you already know how to get the new contact information as ABRecordRef, then try

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