tags:

views:

89

answers:

2

Hi,

I need to get the current location name of the iphone user. How can i get the location name. i am new to iphone development please help

Thanks,

A: 

You'll want to look at the LocateMe example, and at the CoreLocation reference in the SDK docs. It's possible you'll need to make GoogleMaps or similar webservice lookups to find the location names with your data.

phoebus
A: 

You can get location name by co-ordinates. For that, you will need to use MKReverseGeocoder class.

MKReverseGeocoder *reverseGeocoder=[[MKReverseGeocoder alloc]initWithCoordinate:yourcoordinate];
reverseGeocoder.delegate = self;
[reverseGeocoder start];

You will need to include MKReverseGeocoderDelegate protocol and use its method

  • -(void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark)placemark

You can more information by looking at documentation of MKReverseGeocoder.

Hope it helps.

Napster