2

Hi i am working on an ios app. I want to get the current location of the device using GPS. How can i get latitude and longitude of a place,and from them how can i determine current city name. I came across example from following http://www.appcoda.com/how-to-get-current-location-iphone-user/ but when i pressed the button nothing happened.I am using IOS simulator and i have changed the Debug --> Location --> to Apple.

I am developing for ios 8.0

Sarao
  • 379
  • 1
  • 7
  • 18
  • You want to geocode to the address (get the GPS coordinate of a user entered text address). There is an example given here: http://stackoverflow.com/questions/10735981/geocoding-address-into-coordinates-in-iphone As for the get current city name, I don't know how to do that. – Zhang Apr 15 '15 at 11:27

1 Answers1

1

In iOS 8 apple changes some plist keys and entry for location access..

Please follow the below step to keep your core work..

  • NSLocationAlwaysUsageDescription
  • NSLocationWhenInUseUsageDescription See Apple document for plist.
  • Before startUpdatingLocation & after allocation CLLocationManager add this code for location services permissions
if ([locationManager respondsToSelector:@selector(requestAlwaysAuthorization)])
{
  [locationManager requestAlwaysAuthorization];
}
Bevin Patel
  • 302
  • 3
  • 11