Core Location Functions Reference

Companion guide
Declared in
CLLocation.h

Overview

The Core Location framework provides functions to help you work with coordinate values.

Functions

CLLocationCoordinate2DIsValid

Returns a Boolean indicating whether the specified coordinate is valid.

BOOL CLLocationCoordinate2DIsValid(
   CLLocationCoordinate2D coord)
Parameters
coord

A coordinate containing latitude and longitude values.

Return Value

YES if the coordinate is valid or NO if it is not.

Discussion

A coordinate is considered invalid if it meets at least one of the following criteria:

  • Its latitude is greater than 90 degrees or less than -90 degrees.

  • Its longitude is greater than 180 degrees or less than -180 degrees.

Availability
  • Available in iOS 4.0 and later.
Declared In
CLLocation.h

CLLocationCoordinate2DMake

Formats a latitude and longitude value into a coordinate data structure format.

CLLocationCoordinate2D CLLocationCoordinate2DMake(
   CLLocationDegrees latitude,
   CLLocationDegrees longitude)
Parameters
latitude

The latitude for the new coordinate.

longitude

The longitude for the new coordinate.

Return Value

A coordinate structure encompassing the latitude and longitude values.

Availability
  • Available in iOS 4.0 and later.
Related Sample Code
Declared In
CLLocation.h