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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:29:48+00:00 2026-06-09T03:29:48+00:00

I have a label timer inside a UITableViewCell , using this code – (UITableViewCell

  • 0

I have a label timer inside a UITableViewCell, using this code

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [[UITableViewCell alloc]init];

    timeLabel = [[UILabel alloc]initWithFrame:CGRectMake(55, 26, 280, 25)];
    timeLabel.text = [timeArray objectAtIndex:indexPath.row];
    timeLabel.backgroundColor = [UIColor clearColor];
    timeLabel.textColor = [UIColor blackColor];

    [cell.contentView addSubview:timeLabel];
    return cell;
    NSLog(@"Title %@, time %@, second %@, time %i, tag %d", titleArray, timeArray, secondArray, time, button.tag);
}

And I have a timer that trigger by a button using this code

- (void)onoffBtn:(id)sender
{
    countdownTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timerElapsed:) userInfo:nil repeats:YES];
}

- (void) timerElapsed:(id)timer
{
    if (time == 0)
    {
        [countdownTimer invalidate];
    }
    // this part only code for counting down timer
    NSLog(@"%d:%d:%d", hour , minute, second);
}

If I put timeLabel.text = [NSString stringWithFormat:@"%d:%d:%d", hour , minute, second]; inside timerElapsed, of course it wont update my label inside cell.

So how do I update my label inside cell for every second?

  • 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-09T03:29:50+00:00Added an answer on June 9, 2026 at 3:29 am

    Put timeLabel.text = [NSString stringWithFormat:@"%d:%d:%d", hour , minute, second]; inside cellForRowAtIndexPath and call reloadData method of your tableview inside timerElapsed.

    I believe your hour, minute and second contain updated value.

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

Sidebar

Related Questions

This is my cellForRowAtIndexPath UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) {
I have a label and this code: string User = Environment.UserName; toolStripStatusLabel1.Text = This
What i'm trying to do is animating a label when timer ticks. I have
i have this crazy label for each time i create a migration that use
I have a Label that translates a code inserted by the user to the
I have a label in my form. I want this label to dynamically change
I have this label: <label id=options_31409_3label for=options_31409_3><span>some text</span></label> As you see, there is some
I have a link inside a label. The problem is, when user clicks 'back'
i have one label out of update panel and one button inside update panel.
This is using jQuery 1.6.1 and Validate 1.8.1. I have been banging my head

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.