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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:57:29+00:00 2026-05-30T16:57:29+00:00

I am a real n00b in developing iOS app. This is my first application

  • 0

I am a real n00b in developing iOS app. This is my first application in my life and I really need some helps.

My app concept is running workout.

  • When user click button ‘start run’, app will track a distance which inform users how far do they run in another view.

  • Next, when the user click button ‘Finish workout’, the distance will be added(plused) to the ‘total distance’ variable which need to be saved all the time when finishing each run trip.

  • Moreover, ‘total distance’ must load when app starts in index view.

As I mentioned, I am a beginner so that could anybody please tell me how to do? where should I put the code and how? I will appreciate sample code as well. I need to know how could I plus the new(fresh) data with saved data and how to save and show it.

Really sorry for my English.

Thank you in your advance support.

====EDITED==================
Here is my code in calculating distance function.

-(void)computeDistanceFrom:(CLLocation *)oldL tO:(CLLocation *)newL {

NSLog(@"oldd %@",oldL);
NSLog(@"new %@",newL);

CLLocationDistance currentDistance = [oldL distanceFromLocation:newL];
NSLog(@"you have travel=%f",currentDistance);   
distance = distance + currentDistance;

double distanceInKm = distance/1000;

distanceLabelValue = [[NSString stringWithFormat:@"%1.2f",distanceInKm]retain];
distanceLabel.text = distanceLabelValue;


}   

Now I can get distance which user workouts each time. But I dunt know how and where to create ‘total distance’ variable. Then plus the workout distance to ‘total distance’. And Finally save ‘total distance’ and show it in the index view.

please help…

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

    Use NSUserDefaults to save your data.

    For saving your data, for example ‘1.25’:

       NSDecimalNumber *myNumber = [NSDecimalNumber decimalNumberWithDecimal:
                             [[NSNumber numberWithFloat:1.25f] decimalValue];
    
        NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
        [prefs setObject:myNumber forKey:@"myTotal"];
        [prefs synchronize];
    

    For retrieving your data:

    NSDecimalNumber *myAcc = (NSDecimalNumber *)[prefs objectForKey:@"myTotal"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Real-life case (helps understand the question) I am building a device that can freely
My real-life example is too obscure to explain, but this is a pretty good
Real simple question really. I need to read a Unicode text file in a
I'm a real coding n00b so apologies if this is a simple or basic
Reading Real world Haskell i found some intresting question about data types: This pattern
This is a real n00b question but i am very new at this and
Considering real life situation, suppose i have assigned some work to 3 people(say Person
I'm doing real-time frame-by-frame analysis of a video stream in iOS. I need to
I am having some real trouble with this, below is the code, I am
Real UID, effective UID, and some systems even have a saved UID. What's the

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.