Note that there are some explanatory texts on larger screens.

plurals
  1. POFor n00b:Sending numeric data to plus another data then save summary Data in different View NSUserDefault
    primarykey
    data
    text
    <p>I am a real n00b in developing iOS app. This is my first application in my life and I really need some helps.</p> <p>My app concept is running workout. </p> <ul> <li><p>When user click button 'start run', app will track a distance which inform users how far do they run in another view. </p></li> <li><p>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.</p></li> <li><p>Moreover, 'total distance' must load when app starts in index view. </p></li> </ul> <p>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.</p> <p>Really sorry for my English.</p> <p>Thank you in your advance support.</p> <p>====EDITED================== Here is my code in calculating distance function.</p> <pre><code>-(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; } </code></pre> <p>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.</p> <p>please help...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload