-2

I was working on the Map kit where I want my current location to be displayed, but instead I am getting US location.

So can any one suggest me how to find the current location?

Noor
  • 2,071
  • 19
  • 28
Sam
  • 571
  • 1
  • 6
  • 22

2 Answers2

0

On iOS5 Simulator by default you it will show some location in USA. If you want to change that location, in iOS Simulator menu, go to Debug -> Location -> Custom Location. There you can set the latitude and longitude and test the app accordingly. This works with mapkit and also with CLLocationManager.

Noor
  • 2,071
  • 19
  • 28
0

First import CoreLocation framework in your project. Test this project in real device. You can not find current location of user in iOS Simulator.

CLLocationCoordinate2D location = [[[mapview userLocation] location] coordinate];  
NSLog(@"Location found from Map: %f %f",location.latitude,location.longitude);
Gajendra Rawat
  • 3,673
  • 2
  • 19
  • 36