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

  • Home
  • SEARCH
  • 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 6685417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:03:19+00:00 2026-05-26T05:03:19+00:00

I use a UISlider to get the input in minutes (range 1 – 120)

  • 0

I use a UISlider to get the input in minutes (range 1 – 120) for a countdown timer and show it on a label like this “01:30:00”.
i) I would like when the user sets the timer (using the slider) to adjust the hours and minutes but NOT the seconds. The seconds should start counting AFTER the user starts the countdown. How can i do that?
ii) i have trouble updating the countdownlabel. Could somebody suggest the correct code?

-(IBAction)setTime:(id)sender {
totaltime=timeSlider.value;
hours = totaltime / 60;
minutes = (totaltime % 3600) % 60;
seconds = (totaltime % 3600) * 60;
[countDownLabel setFont:[UIFont fontWithName:@"DBLCDTempBlack" size:45]];
countDownLabel.text = [NSString stringWithFormat:@"%.2i:%.2i:%.2i", hours, minutes, seconds]; }

 -(void)countdown {
 totaltime -=1; 


if(minutes == 0) { [timer invalidate]; }    
 [countDownLabel setFont:[UIFont fontWithName:@"DBLCDTempBlack" size:45]];
 countDownLabel.text = [NSString stringWithFormat:@"%.2i:%.2i:%.2i", hours, minutes, seconds]; }
-(IBAction)fade {
timer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                        target:self selector:@selector (countdown)  userInfo:nil repeats:YES]; }
  • 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-26T05:03:19+00:00Added an answer on May 26, 2026 at 5:03 am
    -(IBAction)setTime:(id)sender {
    totaltime=timeSlider.value;
    hours = totaltime / 60;
    minutes = (totaltime % 3600) % 60;
    seconds = (totaltime % 3600) * 60;
    [countDownLabel setFont:[UIFont fontWithName:@"DBLCDTempBlack" size:45]];
    countDownLabel.text = [NSString stringWithFormat:@"%.2i:%.2i:%.2i", hours, minutes, seconds]; }
    
     -(void)countdown {
     totaltime -=1; 
    totaltime=timeSlider.value;
    hours = totaltime / 60;
    minutes = (totaltime % 3600) % 60;
    seconds = (totaltime % 3600) * 60;
    countDownLabel.text = [NSString stringWithFormat:@"%.2i:%.2i:%.2i", hours, minutes, seconds];
    
    
    if(minutes == 0) { [timer invalidate]; }    
     [countDownLabel setFont:[UIFont fontWithName:@"DBLCDTempBlack" size:45]];
     countDownLabel.text = [NSString stringWithFormat:@"%.2i:%.2i:%.2i", hours, minutes, seconds]; }
    -(IBAction)fade {
    timer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                            target:self selector:@selector (countdown)  userInfo:nil repeats:YES]; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using a UISlider in my app but I'd like to use a custom
I want to use a vertical UISlider . I have no idea about how,
use this website a lot but first time posting. My program creates a number
let's say I have a jQuery UI Slider like so: $(.mySlider).slider({ range: min, min:
I'm currently trying to get a UISlider to work. I'm trying to set the
I have a custom UISlider and use the currentPlaybackTime to change values of an
i have IBOutlet uislider. i want it to show the value of slider when
I want to use the jQuery UI Slider I Used this code: $( .slider
Use OPENXML to get dt element in MSSQL 2005. How can I get xmlns:dt
this might be a simple questions but I can't get my head around it.

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.