不同国家/地区的联系地址格式 [英] Contact address format for different countries

查看:93
本文介绍了不同国家/地区的联系地址格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个应用程序中,我正在使用 ABRecordRef 显示联系人的详细信息.我正在使用键 kABPersonAddressCityKey kABPersonAddressStateKey kABPersonAddressZIPKey kABPersonAddressCountryKey .一切正常.但是我不知道显示地址的格式.我的意思是,如果您看到 Contacts应用 ,则地址将以不同国家/地区的特定格式显示.一些例子,

In an app, I am displaying the details of the contacts using ABRecordRef. I am using the keys kABPersonAddressCityKey, kABPersonAddressStateKey, kABPersonAddressZIPKey, kABPersonAddressCountryKey. Everything works fine. But I don't know in which format to display the addresses. What I mean is, if you see the Contacts app, the addresses are displayed in a particular format for different countries. Some examples,

美国

街道
城市州ZIP
国家

Street
City State ZIP
Country

印度

街道

城市PIN
国家

Street
Province
City PIN
Country

澳大利亚

街道
郊区国家ZIP
国家

Street
Suburb State ZIP
Country

现在,我不知道如何查找不同国家/地区的格式.

Now I don't know how to find the format for different countries.

1.是否可以根据国家/地区代码找到地址格式?
2.是否有一种方法可以使用单个函数来获取全格式的地址,就像我们使用 ABRecordCopyCompositeName()来获取全名一样?

1.Is there any way to find the address format based on country/country codes?
2.Is there a way we can get the fully formatted address using a single function, like we use ABRecordCopyCompositeName() to get the full name?

推荐答案

尝试使用此链接 ABCreateStringWithAddressDictionary

您似乎需要使用:ABCreateStringWithAddressDictionary,它将返回:

It looks like you need to use: ABCreateStringWithAddressDictionary that will return:

从地址属性返回格式化的地址. (来自Apple)

Returns a formatted address from an address property. (From Apple)

祝你好运

这篇关于不同国家/地区的联系地址格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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