Hi, I am trying to pass the found location to the maps.app, but for some reason, the string passed to the map shows a location of "0.0000, 0.0000" instead of the correct Lat and Long the CLLocation manager just found. Here is my code:
{
if (wasFound) return;
wasFound = YES;
CLLocationCoordinate2D loc = [newLocation coordinate];
latitude.text = [NSString stringWithFormat: @"%f", loc.latitude];
longitude.text = [NSString stringWithFormat: @"%f", loc.longitude];
altitude.text = [NSString stringWithFormat: @"%f", newLocation.altitude];
}
-(IBAction)openMaps{
NSString *mapUrl = [NSString stringWithFormat: @"http://maps.google.com/maps?q=%f,%f"];
NSURL *url = [NSURL URLWithString:mapUrl];
[[UIApplication sharedApplication] openURL:url];
}
Can anyone tell me what I am doing wrong? What am I missing? Thanks for any help.
{
if (wasFound) return;
wasFound = YES;
CLLocationCoordinate2D loc = [newLocation coordinate];
latitude.text = [NSString stringWithFormat: @"%f", loc.latitude];
longitude.text = [NSString stringWithFormat: @"%f", loc.longitude];
altitude.text = [NSString stringWithFormat: @"%f", newLocation.altitude];
}
-(IBAction)openMaps{
NSString *mapUrl = [NSString stringWithFormat: @"http://maps.google.com/maps?q=%f,%f"];
NSURL *url = [NSURL URLWithString:mapUrl];
[[UIApplication sharedApplication] openURL:url];
}
Can anyone tell me what I am doing wrong? What am I missing? Thanks for any help.