Formatter types include: MAFAddressFormatter class for phone numbers and address field layout information, MAFDateTimeFormatter for date times, and MAFCurrencyFormatter for currencies.
All three types of formatters use metadata to format input values according to the predefined locale, country, and custom settings.
For MAFDateTimeFormatter, the metadata comes from and is handled completely by the iOS frameworks. The formatter uses the NSDate class to format date and time values according to locale and country settings.
For MAFAddressFormatter and MAFCurrencyFormatter, the metadata is loaded from the default XML and .plist resource files provided with MAF. You can easily configure these files if necessary.
A regular Xcode project .plist file lists the country codes with the corresponding country names. The processed and parsed output is used by the MAFAddressFormatter. MAF also provides a MAFCountryCodeStore class that you can use to query the country code for a country and vice versa. This class and its query methods are available via the public MAF API.
<ISO_CURRENCY> <ENTITY>HUNGARY</ENTITY> <CURRENCY>Forint</CURRENCY> <ALPHABETIC_CODE>HUF</ALPHABETIC_CODE> <NUMERIC_CODE>348</NUMERIC_CODE> <MINOR_UNIT>2</MINOR_UNIT> </ISO_CURRENCY>
This information is also available in the low- and high-level public MAF APIs of the MAFAddressFormatter class. See the public API in the corresponding header file (MAFAddressFormatter.h), and the MAFAddressFormatter section.
<!-- Hungary --> <format country="hu"> <addresses> <address format="POSTL_COD1 CITY\nSTREET HOUSE_NO\nLOCATION\nCOUNTRY" /> </addresses> <addressfields> <line> <field id="POSTL_COD1" keyboard="NUMERIC" label="{POSTAL_CODE}" /> <field id="CITY" label="{CITY}" /> </line> <line> <field id="STREET" width="65%" label="{STREET}" /> <field id="HOUSE_NO" keyboard="NUMERIC" width="35%" label="No." /> </line> <line> <field id="LOCATION" label="{STREET} 4" /> </line> <line> <field id="COUNTRY" label="{COUNTRY}" /> </line> </addressfields> <phonenumbers localprefix="06" internationalprefix="36 " outboundcode="00"> <phonenumber format="06 1 xxx-xxxx" /> <phonenumber format="06 xx xxx-xxx" /> <phonenumber format="06 xx xxx-xxxx" /> </phonenumbers> </format>