current location from CoreLocation

Posted by Christian on Stack Overflow See other posts from Stack Overflow or by Christian
Published on 2010-04-05T16:53:03Z Indexed on 2010/04/05 17:03 UTC
Read the original article Hit count: 539

Filed under:
|

I have an App which launches the google Map App. The code is:

UIApplication *app = [UIApplication sharedApplication]; 
[app openURL:[[NSURL alloc] initWithString: @"http://maps.google.com/maps?daddr=Obere+Laube,+Konstanz,+Germany&saddr="]]; 

The saddr= should be the current location. I get the current location with

-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {

NSLog(@"%f,%f", [newLocation coordinate]);

The Log displays the correct coordinates like

2010-04-05 15:33:25.436 deBordeaux[60657:207] 37.331689,-122.030731

I didn't find the right way to transmit the coordinates to the url-string. Does someone can give me a hint how-to?

© Stack Overflow or respective owner

Related posts about iphone-sdk-3.0

Related posts about google-maps