Instance Method


Tells the delegate that the location manager was unable to retrieve a location value.


- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error;



The location manager object that was unable to retrieve the location.


The error object containing the reason the location or heading could not be retrieved.


If you do not implement this method, Core Location throws an exception when attempting to use location services.

The location manager calls this method when it encounters an error trying to get the location or heading data. If the location service is unable to retrieve a location right away, it reports a kCLErrorLocationUnknown error and keeps trying. In such a situation, you can simply ignore the error and wait for a new event. If a heading could not be determined because of strong interference from nearby magnetic fields, this method returns kCLErrorHeadingFailure.

If the user denies your application’s use of the location service, this method reports a kCLErrorDenied error. Upon receiving such an error, you should stop the location service.

See Also

Responding to Location Events

- locationManager:didUpdateLocations:

Tells the delegate that new location data is available.

- locationManager:didFinishDeferredUpdatesWithError:

Tells the delegate that updates will no longer be deferred.

- locationManager:didUpdateToLocation:fromLocation:

Tells the delegate that a new location value is available.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software