title: Timer lable in the uitableviewcell in the UITableView overrides my timer lable so it runs speed , how to control the speed? ios
body: <p>My issue is i am having the <code>UITableViewCell</code> it contains one <code>UILable</code> and that is customized lable my <code>UITableView</code> have around 300 to 400 records. My requirement is i need to run the count down timer. The data is coming from service simultaneously i need to update the data in local.</p>
  
  <p>Any solution for this would be highly appreciable...</p>
  
  <p><strong>My code for Customized label:</strong>  </p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface TimLabel : UILabel
  
  @property (nonatomic, strong) NSTimer *startTimer;
  @property (nonatomic) BOOL isDays;
  
  -(void)configureTimeString:(NSString*)timeString;
  - (void)startCounter;
  
  @end
  
  
  //
  //  TimLabel.m
  //  ap
  //
  //  Created by xxxxx on 06/11/14.
  //  Copyright (c) 2014 xxx. All rights reserved.
  //
  
  #import "TimLabel.h"
  @interface TimLabel ()
  {
      int secondsLeft;
  
  }
  @end
  @implementation TimLabel
  
  - (id)initWithFrame:(CGRect)frame
  {
      self = [super initWithFrame:frame];
      if (self) {
          // Initialization code
  
      }
      return self;
  }
  
  /*
  // Only override drawRect: if you perform custom drawing.
  // An empty implementation adversely affects performance during animation.
  - (void)drawRect:(CGRect)rect
  {
      // Drawing code
  
  //    [UIView animateWithDuration:3.0f animations:
  //     ^{
  //        [self setTextColor:[UIColor redColor]];
  //    } completion:^(BOOL finished)
  //    {
  //        
  //    }];
  }
  */
  
  
  -(void)configureTimeString:(NSString*)timeString
  {
      NSArray * timerArray = [timeString componentsSeparatedByString:@":" ];
      int hours, minutes, seconds;
      hours = [[timerArray objectAtIndex:0 ] intValue];
      minutes = [[timerArray objectAtIndex:1] intValue];
      seconds = [[timerArray objectAtIndex:2] intValue];
      secondsLeft =hours * 3600 + minutes * 60 + seconds;
  //    if (!self.isDays) {
          [self startCounter];
  //    }
  }
  
  - (void)startCounter
  {
     self.startTimer = [NSTimer scheduledTimerWithTimeInterval: 1.0 target:self selector:@selector(updateCountdown) userInfo:nil repeats: YES];
      if (![self.startTimer isValid]) {
          [self.startTimer fire];
      }
  }
  
  -(void) updateCountdown
  {
      int hours, minutes, seconds;
      secondsLeft--;
      hours = secondsLeft / 3600;
      minutes = (secondsLeft % 3600) / 60;
      seconds = (secondsLeft %3600) % 60;
      if (secondsLeft &gt;= 0) {
          self.text = [NSString stringWithFormat:@"%02d:%02d:%02d", hours, minutes, seconds];
      }
      else
      {
         [self.startTimer invalidate];
      }
       [[NSRunLoop mainRunLoop] addTimer:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
  }
  
  
  
  @end
  </code></pre>