Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Pyro2b

macrumors newbie
Original poster
Aug 2, 2004
28
0
California
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.