MKPlacemark Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/MapKit.framework |
| Availability | Available in iOS 3.0 and later. |
| Companion guide | |
| Declared in | MKPlacemark.h |
Overview
A MKPlacemark object stores placemark data for a given latitude and longitude. Placemark data includes information such as the country, state, city, and street address associated with the specified coordinate. You can initialize a placemark using the initWithPlacemark: inherited method or the initWithCoordinate:addressDictionary: method specifying a coordinate and address dictionary.
A placemark is also an annotation and conforms to the MKAnnotation protocol, whose properties and methods include the placemark coordinate and other information. Because they are annotations, you can add them directly to the map view.
Properties
countryCode
The abbreviated country name. (read-only)
Discussion
This string is the standard abbreviation used to refer to the country. For example, if the placemark location was Apple’s headquarters, the value for this property would be the string “US”.
Availability
- Available in iOS 3.0 and later.
Declared In
MKPlacemark.hInstance Methods
initWithCoordinate:addressDictionary:
Initializes and returns a placemark object using the specified coordinate and Address Book dictionary.
Parameters
- coordinate
The map coordinate to associate with the placemark.
- addressDictionary
A dictionary containing keys and values from an Address Book record. For a list of strings that you can use for the keys of this dictionary, see the “Address Property” constants in ABPerson Reference. All of the keys in should be at the top level of the dictionary.
Return Value
An initialized MKPlacemark object.
Discussion
You can create placemark objects manually for entities for which you already have address information, such as contacts in the Address Book. Creating a placemark object explicitly avoids the need to query the reverse geocoder object for the same information.
Availability
- Available in iOS 3.0 and later.
Declared In
MKPlacemark.h© 2011 Apple Inc. All Rights Reserved. (Last updated: 2011-10-12)