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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:31:56+00:00 2026-05-31T22:31:56+00:00

I made a very basic dictionary that just stores a username in it, and

  • 0

I made a very basic dictionary that just stores a username in it, and I also want to store dynamically generated latlngs in it as well. I can already get the current latlng, and am working on how to track the location and store the new latlngs, which updates based on either distance or time.

How would I go about storing multiple latitudes under the key ‘latitude’ and the same for longitude?

My dictionary with the username is here:

username = Textbox.text;

    NSMutableDictionary *mydata = [[NSMutableDictionary alloc] init ];

    [mydata setObject:username forKey:@"username"];
    NSLog(@"%@", [mydata objectForKey:@"username"]);

My current location code is here:

locationManager =[[CLLocationManager alloc] init];

locationManager.delegate = self; 
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
locationManager.distanceFilter = 100.0f;
[locationManager startUpdatingLocation];

CLLocation *location = [locationManager location];
CLLocationCoordinate2D coordinate = [location coordinate];
NSString *latitude = [NSString stringWithFormat:@"%f", coordinate.latitude];
NSString *longitude = [NSString stringWithFormat:@"%f", coordinate.longitude];

Any help would be greatly appreciated.

  • 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-31T22:31:57+00:00Added an answer on May 31, 2026 at 10:31 pm

    If you have two latitudes…

    float latitudeA;
    float latitudeB;
    

    that you’d like to put in an array, first “wrap” them up as NSNumbers…

    NSNumber *numLatitudeA = [NSNumber numberWithFloat:latitudeA];
    NSNumber *numLatitudeB = [NSNumber numberWithFloat:latitudeB];
    

    which will let you put them in an array…

    NSArray *myLatitudes = [NSArray arrayWithObjects:numLatitudeA, numLatitudeB, nil];
    

    which can be placed in your dictionary (under the key @”latitude” if you want)…

    [myData setValue:myLatitudes forKey:@"latitude"];
    

    Though, you might want to associate several latitude arrays with different unique longitudes. If so, instead of using the string @”latitude” as the key, the longitude itself (if it’s an NSNumber) can be a perfectly good key.

    NSNumber *numLongitude = [NSNumber numberWithFloat:longitude];
    [myData setObject:myLatitudes forKey:numLongitude];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very basic regular expression that I just can't figure out why
I am a very new programmer, I have made a couple basic applications, however
I've made a very simple REST controller method with Spring 3.0.0.RC1 that uses hibernate
I just installed Ubuntu 8.04 and Eclipse. I made a very simple Hello World
We have a number of very old data entry forms that were made in
I might be asking a very basic question and I am sorry for that.
I'm working on a very simple Firefox extension that will log info and dynamically
Don't be frightened, its a very basic code. Just wanted to check with you
I made a very basic example, and when I use a hyphen on the
I am learning C++ and made a script, a very basic player attacking monster

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.