Class

MKDistanceFormatter

A utility object that converts between a geographic distance and a string-based expression of that distance.

Declaration

@interface MKDistanceFormatter : NSFormatter

Overview

You use a distance formatter when you need to display distances to the user or when you want to parse user-specified text to obtain a numerical value for a distance. When formatting strings containing distances, a distance formatter object takes into account the user’s locale and language settings. You can also specify a custom locale or custom units for any distances that you format.

Topics

Converting Distances

- stringFromDistance:

Creates a string representation of the specified distance.

- distanceFromString:

Returns the distance value parsed from the specified string.

Specifying the Format

locale

The locale to use when formatting strings.

units

The measuring system (imperial or metric) to use for units.

MKDistanceFormatterUnits

Constants that reflect the type of units to use in the string.

unitStyle

The preferred style for units.

MKDistanceFormatterUnitStyle

Constants that indicate the format style to use for strings.

Relationships

Inherits From

See Also

Map Coordinates

MKCoordinateRegion

A rectangular geographic region centered around a specific latitude and longitude.

MKCoordinateSpan

The width and height of a map region.

MKMapRect

A rectangular area on a two-dimensional map projection.

MKMapPoint

A point on a two-dimensional map projection.

MKMapSize

Width and height information on a two-dimensional map projection.