iOS 是否有输入和存储街道地址的标准方法?

发布于 2024-12-17 18:29:04 字数 236 浏览 4 评论 0原文

我想提示输入街道地址,方式与通讯录应用程序完全相同。

我可以模仿它的用户界面,但这将涉及复制许多现有功能;国家/地区列表,它根据国家/地区选择、验证、格式、本地化等重新配置的方式。是否有现有的框架可以提供此功能?

我还将输入的值存储在核心数据中,当然它没有地址类型。单独存储字段、使用 Transformable 还是仅使用纯字符串更好?是否有一个现有的类我可以为此重用/子类化?

我可以假设需要 iOS 5。

I'd like to prompt for a street address, in exactly the same way as the Contacts app.

I could mimic its UI, but that would involve duplicating a lot of existing functionality; the country list, the way it re-configures based on the country selection, validation, formatting, localization, etc. Is there an existing framework that provides this?

I'm also storing the entered value in Core Data, which of course doesn't have an Address type. Is it preferable to store the fields individually, use Transformable, or just use a plain string? Is there an existing class that I could re-use/subclass for this?

I can assume that iOS 5 is required.

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

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

发布评论

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

评论(2

凉栀 2024-12-24 18:29:05

不,不幸的是,事实并非如此。不过,有一些项目可以对此有所帮助。您可能会发现我的项目 QuickDialog 对此很有用: QuickDialog

No it doesn't, unfortunately. There are a few projects that help with this, though. You might find my project QuickDialog useful for this: QuickDialog

情何以堪。 2024-12-24 18:29:05

据我所知,这很好,但可能无法满足您的需求。来自 地址簿编程指南

地址簿 UI 框架提供了四个控制器:

ABPeoplePickerNavigationController 提示用户从其地址簿中选择一个人记录。
ABPersonViewController 向用户显示人员记录并可选择允许编辑。
ABNewPersonViewController 提示用户创建新的人员记录。
ABUnknownPersonViewController 提示用户完成部分人员记录,也可以选择允许他们将其添加到地址簿中。

This is as good as I know of, but may not meet your needs. From The Address Book Programming Guide:

The Address Book UI framework provides four controllers:

ABPeoplePickerNavigationController prompts the user to select a person record from their address book.
ABPersonViewController displays a person record to the user and optionally allows editing.
ABNewPersonViewController prompts the user create a new person record.
ABUnknownPersonViewController prompts the user to complete a partial person record, optionally allows them to add it to the address book.

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