Class

CNPostalAddressFormatter

An object that you use to format a contact's postal addresses.

Declaration

@interface CNPostalAddressFormatter : NSFormatter

Overview

A CNPostalAddressFormatter object handles international formatting of postal addresses. It is recommended that you create an instance of this class when formatting many postal addresses, and use the instance methods; otherwise use the class methods.

Topics

Generating a Formatted Attributed String

- attributedStringFromPostalAddress:withDefaultAttributes:

Returns a formatted postal address as an attributed string.

+ attributedStringFromPostalAddress:style:withDefaultAttributes:

Returns a postal address as an attributed string and formatted for the specified style.

CNPostalAddressPropertyAttribute

An attribute that identifies the purpose of a range of characters in an attributed string.

CNPostalAddressLocalizedPropertyNameAttribute

An attribute that identifies the localized property of postal address.

Generating a Formatted String

- stringFromPostalAddress:

Returns a formatted postal address.

+ stringFromPostalAddress:style:

Returns a postal address as a string and formatted for the specified style.

Specifying the Formatting Style

style

The style to apply when formatting strings.

CNPostalAddressFormatterStyle

Constants for postal formatting styles.

Getting the Postal Attribute Keys

CNPostalAddressCityKey

The city of the address.

CNPostalAddressCountryKey

The country name of the address.

CNPostalAddressISOCountryCodeKey

The ISO country code of the address.

CNPostalAddressPostalCodeKey

The postal code of the address.

CNPostalAddressStateKey

The state name of the address.

CNPostalAddressStreetKey

The street name of the address.

Relationships

Inherits From

See Also

Formatters

CNContactFormatter

An object that you use to format contact information before displaying it to the user.

CNContactVCardSerialization

An object you use to convert to and from a vCard representation of the user's contacts.

CNContactsUserDefaults

An object that defines the default options to use when displaying contacts.