Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 711857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:46:58+00:00 2026-05-14T04:46:58+00:00

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

  • 0

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?


Hmmm, I had the entry in my .h

In my method I use “newLocation” instead your “location”. The code is:

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

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

storedLocation = [newLocation coordinate];

NSLog(@"Standort neu String: %@", storedLocation);

As result I get :

  • 2010-04-05 20:28:44.397 deBordeaux[64179:207] 37.331689,-122.030731
  • 2010-04-05 20:28:44.398 deBordeaux[64179:207] 37.331689
  • Program received signal: “EXC_BAD_ACCESS”.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:46:59+00:00Added an answer on May 14, 2026 at 4:46 am

    You shouldn’t use addr parameter of the URL but ll.

    You should pass latitude and longitude as

    http://maps.google.com/maps?daddr=Obere+Laube,+Konstanz,+Germany&ll=37.331689,-122.030731
    

    and you can obtain them from the CLocation throught

    [location coordinate].latitude
    [location coordinate].longitude
    

    EDIT:
    First of all you can directly store an object of type CLLocationCoordinate2D and then convert it to a NSString when you need:

    // in your .h
    CLLocationCoordinate2D storedLocation;
    
    // in your method
    storedLocation = [location coordinate];
    
    // when you want to ask google maps
    [NSString stringWithFormat:@"http://maps.google.com/maps?daddr=Obere+Laube,+Konstanz,+Germany&ll=%f,%f", storedLocation.latitude, storedLocation.longitude];
    

    Mind that CLLocationCoordinate2D is defined as

    typedef struct {
       CLLocationDegrees latitude;
       CLLocationDegrees longitude;
    } CLLocationCoordinate2D;
    

    where you have typedef double CLLocationDegrees

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app which has a map and some POI on it. I'm
strong textI have an iPad app which only allows landscape orientation, and launches in
I have an iPhone app which, when it launches, loads in data from a
I have an app in which as soon as user launches the app and
I have a custom DownloadFiles class which extends AsyncTask . The app launches itself
I have VBScript code which launches QuickTest Professional, executes a series of QTP tests,
I have a Spring app which launches a REST Service within an embedded instance
I have a Cocoa app which launches a new NSThread (Thread A) from within
I have app in which i have recorded sound files i want that i
I have a app which will download a file from web. The download action

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.