How to validate latitude and longitude

The Crazy Chimp picture The Crazy Chimp · Oct 16, 2011 · Viewed 41.2k times · Source

I have two UITextFields which users can enter in a latitude and longitude, these co-ordinates are then used to create a pin on an MKMapView.

I want find a way to validate whether the values they enter are actual GPS co-ordinates or just a load of rubbish. Is there any way of doing this?

Answer

rid picture rid · Oct 16, 2011

The latitude must be a number between -90 and 90 and the longitude between -180 and 180.