The MAFAddressFormatter formats phone numbers and addresses, and translates the names of the address fields.
[MAFAddressFormatter instance]
[NSMutableArray arrayWithObjects:[NSMutableDictionary dictionaryWithObjects: [NSArray arrayWithObjects: @"7", @"Zahony", @"Óbuda", @"Budapest", @"Pest", @"1031", @"Hungary",nil] forKeys:[NSArray arrayWithObjects: MAF_FORMATTER_ADDRESS_FIELD_HOUSE_NO, MAF_FORMATTER_ADDRESS_FIELD_STREET, MAF_FORMATTER_ADDRESS_FIELD_LOCATION, MAF_FORMATTER_ADDRESS_FIELD_CITY, MAF_FORMATTER_ADDRESS_FIELD_REGION, MAF_FORMATTER_ADDRESS_FIELD_POSTL_COD1, MAF_FORMATTER_ADDRESS_FIELD_COUNTRY,nil] ]
- (NSString *)formattedAddressWithCountryCode:(NSString *)countryCode values:(NSDictionary *)values;For example:
NSDictionary* addressInputValues = [NSMutableArray arrayWithObjects:[NSMutableDictionary dictionaryWithObjects: [NSArray arrayWithObjects: @"7", @"Zahony", @"Óbuda", @"Budapest", @"Pest", @"1031", @"Hungary",nil] forKeys:[NSArray arrayWithObjects: MAF_FORMATTER_ADDRESS_FIELD_HOUSE_NO, MAF_FORMATTER_ADDRESS_FIELD_STREET, MAF_FORMATTER_ADDRESS_FIELD_LOCATION, MAF_FORMATTER_ADDRESS_FIELD_CITY, MAF_FORMATTER_ADDRESS_FIELD_REGION, MAF_FORMATTER_ADDRESS_FIELD_POSTL_COD1, MAF_FORMATTER_ADDRESS_FIELD_COUNTRY,nil] ]; NSString* result = [[MAFAddressFormatter instance] formattedAddressWithCountryCode:@"HU" values:addressInputValues];
/** * Returns the number of rows for the specified country. * @param countryCode the country code * @returns the number of rows for the specified country */ - (NSUInteger)numberOfAddressRowsWithCountryCode:(NSString *)countryCode; /** * Returns with the array of address rows with the specified values * @param valuesDict the values that make up the address to be displayed * @param countyCode_in the country code which we will format for * @returns the array of the address rows */ - (NSArray*)addressRowsWithValues:(NSDictionary*)valuesDict forCountryCode:(NSString*)countryCode_in;
/** * Returns the rows for the specified country code. For country codes, * see the helper class. For values, see the header file. * @param countryCode the country code * @param values the values to be shown in the field (unspecified values will show the placeholder) * @returns the rows for the specified country code * @remark Probably, you doesn't need to call this, because it's automatically stored when you create the instance or set another locale and used in getAddressRowsWithValues:. */ - (NSArray *)addressRowsWithCountryCode:(NSString *)countryCode;