Instance Method


Creates a location object with the specified latitude and longitude.


- (instancetype)initWithLatitude:(CLLocationDegrees)latitude longitude:(CLLocationDegrees)longitude;



The latitude of the geographical coordinate.


The longitude of the geographical coordinate.

Return Value

A location object initialized with the specified geographical coordinate.


Use this method to create location objects that are not necessarily based on the user's current location. Typically, you acquire location objects from your CLLocationManager object, which returns the user's actual location. However, you might use this method when you want to represent any location on a map. For example, you might create an object to represent the user's intended destination.

This method records the latitude and longitude values you provide, and it initializes other properties to appropriate default values. Specifically, this method sets the altitude and horizontalAccuracy properties to 0, sets the verticalAccuracy property to -1 to indicate that the altitude is invalid, sets the speed and course values to -1, and sets the timestamp property to the time at which the returned object was created.

See Also

Initializing a Location Object

- initWithCoordinate:altitude:horizontalAccuracy:verticalAccuracy:timestamp:

Creates a location object with the specified coordinate and altitude information.

- initWithCoordinate:altitude:horizontalAccuracy:verticalAccuracy:course:speed:timestamp:

Creates a location object with the specified coordinate, altitude, and course information.