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?
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?
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.
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);