Core Location Constants Reference

Framework
CoreLocation/CoreLocation.h
Declared in
CLError.h
CLErrorDomain.h
CLHeading.h
CLLocation.h
CLLocationManager.h

Overview

This document describes the constants found in the Core Location framework.

Constants

CLDeviceOrientation

The physical orientation of the device.

typedef enum {
   CLDeviceOrientationUnknown = 0,
   CLDeviceOrientationPortrait,
   CLDeviceOrientationPortraitUpsideDown,
   CLDeviceOrientationLandscapeLeft,
   CLDeviceOrientationLandscapeRight,
   CLDeviceOrientationFaceUp,
   CLDeviceOrientationFaceDown
} CLDeviceOrientation;
Constants
CLDeviceOrientationUnknown

The orientation is currently not known.

Available in iOS 4.0 and later.

Declared in CLLocationManager.h.

CLDeviceOrientationPortrait

The device is in portrait mode, with the device held upright and the home button at the bottom.

Available in iOS 4.0 and later.

Declared in CLLocationManager.h.

CLDeviceOrientationPortraitUpsideDown

The device is in portrait mode but upside down, with the device held upright and the home button at the top.

Available in iOS 4.0 and later.

Declared in CLLocationManager.h.

CLDeviceOrientationLandscapeLeft

The device is in landscape mode, with the device held upright and the home button on the right side.

Available in iOS 4.0 and later.

Declared in CLLocationManager.h.

CLDeviceOrientationLandscapeRight

The device is in landscape mode, with the device held upright and the home button on the left side.

Available in iOS 4.0 and later.

Declared in CLLocationManager.h.

CLDeviceOrientationFaceUp

The device is held parallel to the ground with the screen facing upwards.

Available in iOS 4.0 and later.

Declared in CLLocationManager.h.

CLDeviceOrientationFaceDown

The device is held parallel to the ground with the screen facing downwards.

Available in iOS 4.0 and later.

Declared in CLLocationManager.h.

kCLErrorDomain

The domain for Core Location errors.

extern NSString *const kCLErrorDomain;
Constants
kCLErrorDomain

The domain for Core Location errors. This value is used in the NSError class.

Available in iOS 2.0 and later.

Declared in CLErrorDomain.h.

CLError

Error codes returned by the location manager object.

typedef enum {
   kCLErrorLocationUnknown  = 0,
   kCLErrorDenied,
   kCLErrorNetwork,
   kCLErrorHeadingFailure,
   kCLErrorRegionMonitoringDenied,
   kCLErrorRegionMonitoringFailure,
   kCLErrorRegionMonitoringSetupDelayed,
   kCLErrorRegionMonitoringResponseDelayed,
   kCLErrorGeocodeFoundNoResult,
   kCLErrorGeocodeFoundPartialResult,
   kCLErrorGeocodeCanceled,
   kCLErrorDeferredFailed,
   kCLErrorDeferredNotUpdatingLocation,
   kCLErrorDeferredAccuracyTooLow,
   kCLErrorDeferredDistanceFiltered,
   kCLErrorDeferredCanceled,
   kCLErrorRangingUnavailable,
   kCLErrorRangingFailure,
} CLError;
Constants
kCLErrorLocationUnknown

The location manager was unable to obtain a location value right now.

Available in iOS 2.0 and later.

Declared in CLError.h.

kCLErrorDenied

Access to the location service was denied by the user.

Available in iOS 2.0 and later.

Declared in CLError.h.

kCLErrorNetwork

The network was unavailable or a network error occurred.

Available in iOS 3.0 and later.

Declared in CLError.h.

kCLErrorHeadingFailure

The heading could not be determined.

Available in iOS 3.0 and later.

Declared in CLError.h.

kCLErrorRegionMonitoringDenied

Access to the region monitoring service was denied by the user.

Available in iOS 4.0 and later.

Declared in CLError.h.

kCLErrorRegionMonitoringFailure

A registered region cannot be monitored. Monitoring can fail if the app has exceeded the maximum number of regions that it can monitor simultaneously. Monitoring can also fail if the region’s radius distance is too large.

Available in iOS 4.0 and later.

Declared in CLError.h.

kCLErrorRegionMonitoringSetupDelayed

Core Location could not initialize the region monitoring feature immediately.

Available in iOS 4.0 and later.

Declared in CLError.h.

kCLErrorRegionMonitoringResponseDelayed

Core Location will deliver events but they may be delayed. Possible keys in the user information dictionary are described in “Error User Info Keys.”

Available in iOS 5.0 and later.

Declared in CLError.h.

kCLErrorGeocodeFoundNoResult

The geocode request yielded no result.

Available in iOS 5.0 and later.

Declared in CLError.h.

kCLErrorGeocodeFoundPartialResult

The geocode request yielded a partial result.

Available in iOS 5.0 and later.

Declared in CLError.h.

kCLErrorGeocodeCanceled

The geocode request was canceled.

Available in iOS 5.0 and later.

Declared in CLError.h.

kCLErrorDeferredFailed

The location manager did not enter deferred mode for an unknown reason. This error can occur if GPS is unavailable, not active, or is temporarily interrupted. If you get this error on a device that has GPS hardware, the solution is to try again.

Available in iOS 6.0 and later.

Declared in CLError.h.

kCLErrorDeferredNotUpdatingLocation

The location manager did not enter deferred mode because location updates were already disabled or paused.

Available in iOS 6.0 and later.

Declared in CLError.h.

kCLErrorDeferredAccuracyTooLow

Deferred mode is not supported for the requested accuracy. The accuracy must be set to kCLLocationAccuracyBest or kCLLocationAccuracyBestForNavigation.

Available in iOS 6.0 and later.

Declared in CLError.h.

kCLErrorDeferredDistanceFiltered

Deferred mode does not support distance filters. Set the distance filter to kCLDistanceFilterNone.

Available in iOS 6.0 and later.

Declared in CLError.h.

kCLErrorDeferredCanceled

The request for deferred updates was canceled by your app or by the location manager. This error is returned if you call the disallowDeferredLocationUpdates method or schedule a new deferred update before the previous deferred update request is processed. The location manager may also report this error too. For example, if the app is in the foreground when a new location is determined, the location manager cancels deferred updates and delivers the location data to your app.

Available in iOS 6.0 and later.

Declared in CLError.h.

kCLErrorRangingUnavailable

Ranging is disabled. This might happen if the device is in Airplane mode or if Bluetooth or location services are disabled.

Available in iOS 7.0 and later.

Declared in CLError.h.

kCLErrorRangingFailure

A general ranging error occurred.

Available in iOS 7.0 and later.

Declared in CLError.h.

Discussion

Errors are delivered to the delegate using an NSError object.

Error User Info Keys

Keys used in error user information dictionaries.

extern NSString *const kCLErrorUserInfoAlternateRegionKey;
Constants
kCLErrorUserInfoAlternateRegionKey

A key in the user information dictionary of an kCLErrorRegionMonitoringResponseDelayed error whose value is a CLRegion object that the location services can more effectively monitor.

Available in iOS 5.0 and later.

Declared in CLError.h.

Accuracy Constants

Constant values you can use to specify the accuracy of a location.

extern const CLLocationAccuracy kCLLocationAccuracyBestForNavigation;
extern const CLLocationAccuracy kCLLocationAccuracyBest;
extern const CLLocationAccuracy kCLLocationAccuracyNearestTenMeters;
extern const CLLocationAccuracy kCLLocationAccuracyHundredMeters;
extern const CLLocationAccuracy kCLLocationAccuracyKilometer;
extern const CLLocationAccuracy kCLLocationAccuracyThreeKilometers;
Constants
kCLLocationAccuracyBestForNavigation

Use the highest possible accuracy and combine it with additional sensor data. This level of accuracy is intended for use in navigation applications that require precise position information at all times and are intended to be used only while the device is plugged in.

Available in iOS 4.0 and later.

Declared in CLLocation.h.

kCLLocationAccuracyBest

Use the highest-level of accuracy.

Available in iOS 2.0 and later.

Declared in CLLocation.h.

kCLLocationAccuracyNearestTenMeters

Accurate to within ten meters of the desired target.

Available in iOS 2.0 and later.

Declared in CLLocation.h.

kCLLocationAccuracyHundredMeters

Accurate to within one hundred meters.

Available in iOS 2.0 and later.

Declared in CLLocation.h.

kCLLocationAccuracyKilometer

Accurate to the nearest kilometer.

Available in iOS 2.0 and later.

Declared in CLLocation.h.

kCLLocationAccuracyThreeKilometers

Accurate to the nearest three kilometers.

Available in iOS 2.0 and later.

Declared in CLLocation.h.

Specifying an Invalid Coordinate

Use this constant whenever you want to indicate that a coordinate is invalid.

const CLLocationCoordinate2D kCLLocationCoordinate2DInvalid
Constants
kCLLocationCoordinate2DInvalid

An invalid coordinate value.

Available in iOS 4.0 and later.

Declared in CLLocation.h.

Distance Filter Value

This constant indicates the minimum distance required before an event is generated.

extern const CLLocationDistance kCLDistanceFilterNone;
Constants
kCLDistanceFilterNone

All movements are reported.

Available in iOS 2.0 and later.

Declared in CLLocation.h.

Heading Filter Value

This constant indicates the minimum heading change before an event is generated.

const CLLocationDegrees kCLHeadingFilterNone;
Constants
kCLHeadingFilterNone

All heading changes are reported.

Available in iOS 3.0 and later.

Declared in CLHeading.h.