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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:52:45+00:00 2026-06-01T10:52:45+00:00

I have two questions. (First) I’m trying to make it where whenever the iPhone

  • 0

I have two questions. (First) I’m trying to make it where whenever the iPhone moves in location at all, an alert box pops up and shows the longitude where they were, and the latitude where they are now. This is for testing purposes for part of a bigger project I’m working on. Problem is, no alert box is popping up at all. I thought that when the location manager gets a new location, it fires up the delegate which should show the location in an alert box, however nothing is happening at all.

Here is how I’m setting up the Location Manager:

    - (void)viewDidLoad
{
    locationManager =[[CLLocationManager alloc] init];
    locationManager.delegate = self; 
    locationManager.desiredAccuracy = kCLLocationAccuracyBest;
    locationManager.distanceFilter = kCLDistanceFilterNone;
    [locationManager startUpdatingLocation];
}

Here is the delegate:

    -(void) locationmanager: (CLLocationManager *) manager
        didUpdateToLocation: (CLLocation *) newLocation
        fromLocation: (CLLocation *) oldLocation
{  
    float oldlat; 
    float oldlng;
    float lat;
    float lng;
    NSDate *oldtime;
    NSDate *newtime;

    lat = newLocation.coordinate.latitude;
    lng = newLocation.coordinate.longitude;
    newtime = newLocation.timestamp;
    oldlat = oldLocation.coordinate.latitude;
    oldlng = oldLocation.coordinate.longitude;    
    oldtime = oldLocation.timestamp;

    NSNumber *oldlong = [NSNumber numberWithFloat:oldlng];
    NSNumber *newlat = [NSNumber numberWithFloat:lat];  
    UIAlertView *alert = [[UIAlertView alloc]
                          initWithTitle:oldlong
                          message:newlat 
                          delegate:self
                          cancelButtonTitle:@"Cancel"
                          otherButtonTitles:@"Submit",nil];
    [alert show];

(Secondly) once I’m satisfied that I’m able to track the new and old latlng, does anybody know the best way to store the data? I have researched sqlite, core data, and just using arrays, but i’m still having doubts as to whats the best way to store the lat, lng, timestamp and username that will be generated probably a couple hundred times a day for around 200 users, and then send it to a server.

I know this was a long question, but any insight at all 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-06-01T10:52:46+00:00Added an answer on June 1, 2026 at 10:52 am

    Ok. I am really astonished why your application did not crash at this line:

     UIAlertView *alert = [[UIAlertView alloc]
                          initWithTitle:oldlong
                          message:newlat 
                          delegate:self
                          cancelButtonTitle:@"Cancel"
                          otherButtonTitles:@"Submit",nil];
    

    If try to understand UIAlertView parameters properly you will see initWithTitle and message parameters are of type NSString and what you are passing is NSNumber so take two
    NSString for lattitude and longitude and pass them as a parameter like this.

     NSString *long1=[[NSString alloc]initWithFormat:@"%f",oldlong];
     NSString *lat1=[[NSString alloc]initWithFormat:@"%f",newlat];
    
     UIAlertView *alert = [[UIAlertView alloc]
                          initWithTitle:long1
                          message:lat1 
                          delegate:self
                          cancelButtonTitle:@"Cancel"
                          otherButtonTitles:@"Submit",nil];
    

    But showing alert in didUpdateToLocation won’t be a good idea as it will constantly gets called so you will have alert pop up each second locking up your interaction. Though this code worked for me. Have a look at screenshot.

    enter image description here

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

Sidebar

Related Questions

Hi I have two questions about MySQL and QUERIES. First of all i've like
Hey everyone, I want to start using Scheme and I have two questions. First,
I have two questions: 1) How can I make an array which points to
I have two questions. The first is do Filters add a lot of overhead
I have two questions. First one is simple: Is there any way to control
I have two questions. My first one is, that how can i put something
I have two questions concerning fitting a gauss curve to histogram peaks. My first
I have two questions regarding to html table layout. First I will provide some
I have two questions: The first being why exactly my Box2D Body is twice
I have two questions. The first, when i load the activity first item of

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.