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 8734503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:51:10+00:00 2026-06-13T09:51:10+00:00

I am seriously struggling on something that has kept me for hours if not

  • 0

I am seriously struggling on something that has kept me for hours if not days. It’d be awesome if someone can offer input. I figured out how to pass data from a button press to another view, but what I am now trying to do is send longitude and latitude coordinates to the next view as an NSString. Is that possible as an NSString?

I realize at the moment it doesn’t work because I’ve already associates CLLocationCoordinate2D with ‘location,’ but what else can I do now?

Here’s my code:

if ([mlabel.text isEqualToString: @" Arts "])

   {
         CLLocationCoordinate2D location;
         location.latitude = (double) 44.4758;
         location.longitude = (double) -73.2125;

         viewController.stringToDisplay = location;

   }
  • 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-06-13T09:51:11+00:00Added an answer on June 13, 2026 at 9:51 am

    After my post of this question, I implemented an additional view for a total of 3 and so my initial question is different. As of now, my initial view has a category called Arts. The Arts view is reached with the following:

    My first view, as an example, uses the below to open my “Arts” view.

    -(void)mainButton
    {
      if ([mlabel.text isEqualToString: @" Arts " ])
      {
        [self performSegueWithIdentifier:@"Arts" sender:self];
      }
    }
    

    Once at my Arts view, I have my coordinates for my Arts venue to drop in my third view (map) which look like this:

    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    {
      FlipsideViewController *viewController = segue.destinationViewController;
      viewController.delegate = self;
    
      NSString *str;
    
         if ([[segue identifier] isEqualToString:@"showAlternate"]) 
         {
          [[segue destinationViewController] setDelegate:self];
         }
    
         if ([mlabel.text isEqualToString: @" Burlington City Arts "])     
         {
          CLLocationCoordinate2D location;
          location.latitude = (double) 44.476625;
          location.longitude = (double) -73.212827;
    
          str = [NSString stringWithFormat:@"%.2f, %.2f", location.latitude, location.longitude];
    
          viewController.stringToDisplay = str;
         }
    }
    

    What is happening in the above code is that I am declaring stringToDisplay to store the coordinates and send it to the third view. I use a label and say that if my label from a pickerview I have equals the phrase “Burlington City Arts”, then to send the coordinates from that particular place to my third view via my “str” NSString.

    Finally, the code for my third view for that place I want to drop a pin on:

    if ([self.stringToDisplay isEqualToString: @"44.48, -73.21"])
    
    {
        location.latitude = (double) 44.476625;
        location.longitude = (double) -73.212827;
    
        MapViewAnnotation *newAnnotation = [[MapViewAnnotation alloc] initWithTitle:@"newAnnotation" andCoordinate:location];
        [self.mapView addAnnotation:newAnnotation];
        [mapView setCenterCoordinate:location animated:YES];
    }
    

    My stringToDisplay transmits the str NSString with the coordinates to the map view (third view) in the above code, however, the values were rounded and so what I did was I took the rounded figures and put those in my IF statement. Afterwards, I specified the exact coordinates again for the pin to be dropped on. Ta-da!

    *****UPDATE*****
    

    Rather than reiterating coordinates in views 2 and 3, I realize now that the best is to just re-declare the label for each venue, and to pass that label name to the third view so there is no counfusion with coordinates. Those coordinates are specified only once in the third map view which is fine. I pass the label name in my stringToDisplay string, like this:

    if ([mlabel.text isEqualToString: @" The S.P.A.C.E. Gallery "])
            {
                viewController.stringToDisplay = @" The S.P.A.C.E. Gallery ";
    
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This has me seriously stumped. I have a MySQL stored procedure that looks like
I'm seriously stuck here with something obvious. I have an application that communicates with
Seriously. My hosting company says that there's something wrong with my Php code. I'm
Not that it is seriously burdensome to type :My_custom_foobar() instead of just :my_custom_foobar() but
I am getting seriously frustrated that I can't get this to work. I've tried
i am seriously struggling to get my head around regex. I have a sring
I'm working on catching a seriously insidious bug that's happening in my code. The
Google has taken up the implementation of WebRTC in Chrome very seriously as indicated
So basically, I've run into this problem enough times that it is seriously frustrating
I'm seriously confused about the concept of the 'Model' in MVC. Most frameworks that

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.