Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>i done one count Down timer like this way may be its useful for you </p> <pre><code> -(void) viewWillAppear:(BOOL)animated { timer = [NSTimer scheduledTimerWithTimeInterval: 1.0 target:self selector:@selector(updateCountdown) userInfo:nil repeats: YES]; } </code></pre> <p><strong>AND</strong></p> <pre><code> -(void) updateCountdown { NSString *dateString = @"14-09-2012"; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"dd-MM-yyyy"]; NSDate *dateFromString = [[NSDate alloc] init]; // voila! dateFromString = [dateFormatter dateFromString:dateString]; NSDate *now = [NSDate date]; NSCalendar *calendar = [NSCalendar currentCalendar]; NSDateComponents *componentsHours = [calendar components:NSHourCalendarUnit fromDate:now]; NSDateComponents *componentMint = [calendar components:NSMinuteCalendarUnit fromDate:now]; NSDateComponents *componentSec = [calendar components:NSSecondCalendarUnit fromDate:now]; NSCalendar *gregorianCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents *componentsDaysDiff = [gregorianCalendar components:NSDayCalendarUnit fromDate:now toDate:dateFromString options:0]; lblDaysSetting.text=[NSString stringWithFormat:@"%02d",componentsDaysDiff.day]; lblHouresSetting.text=[NSString stringWithFormat:@"%02d",(24-componentsHours.hour)]; lblMinitSetting.text=[NSString stringWithFormat:@"%02d",(60-componentMint.minute)]; lblSecSetting.text=[NSString stringWithFormat:@"%02d",(60-componentSec.second)]; } </code></pre> <p>now just set your logic </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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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