I am trying to get current location of user using CLLocationCoordinate2D. I want the values in the format like
CLLocationCoordinate2D start = {-28.078694,153.382844 };
So that I can use them like following:
NSString *urlAddress = [NSString
stringWithFormat:@"http://maps.google.com/?saddr=%1.6f,%1.6f&daddr=%1.6f,%1.6f",
start.latitude, start.longitude,
destination.latitude, destination.longitude];
I used
CLLocation *location = [[CLLocation alloc]init ];
CLLocationDegrees currentLatitude = location.coordinate.latitude;
CLLocationDegrees currentLongitude = location.coordinate.longitude;
to get current lat & long.
But I am getting 0.000 for both when I try to test. I am testing on iPhone 4s.
If there is any sample code, it will be great.