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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:35:13+00:00 2026-05-12T17:35:13+00:00

i have a view with one slider and a label.i am showing a countdown

  • 0

i have a view with one slider and a label.i am showing a countdown on label and setting time on label using slider.now suppose i have started the timer so the label’s value is decreasing every minute and slider’s value is also decreasing.now i want that if i close my app and then reopen the timer should be already running+label’s value is according to time+slider value is according to time? here is an image what i am doing

alt text

  • 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-12T17:35:13+00:00Added an answer on May 12, 2026 at 5:35 pm

    I’m not sure if I’m missing something, but storing stuff in NSUserDefaults is super easy. To save the slider’s value:

    [[NSUserDefaults standardUserDefaults] setFloat:[mySlider value] forKey:@"sliderValue"];
    

    To save the label’s value:

    [[NSUserDefaults standardUserDefaults] setValue:[myLabel text] forKey:@"textValue"];
    

    To get them back, simply reverse it:

    [mySlider setValue:[[NSUserDefaults standardUserDefaults] floatForKey:@"sliderValue"]];
    

    Personally, I wouldn’t save the string representation of the time left, just the float. You can then restore the timer’s text using whatever existing code you’re using to convert the float value to a string representation.

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

Sidebar

Related Questions

I have slider in one view and Bar chart using core plot in its
How would I have one view up when the iPhone is in a standard
In my application I want to have one view that holds 2 partial views.
I have added one view controller to my first view controller as aa subview
If you have several view models on one page, how do you ensure that
I have one table view that should be filtered by values of search field
I have a FrameLayout view which contains one (MapView-like) control and some additional buttons
I have a view for news items and one for events. I want to
I have senario in which one view and view has binding with multiple ViewModel.
I have two views within one .xib (one view for landscape, another for portrait).

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.