Put the scheduled timer in your uiview to show (or load) the method:
[NSTimer scheduledTimerWithTimeInterval:1.0f // 1 second target:self selector:@selector(updateTime:) userInfo:nil repeats:YES]
Then put this method in your view controller:
- (void) updateTime:(id)sender { NSDate *StrDate = [NSDate date]; NSDateFormatter *Dateformat = [[NSDateFormatter alloc]init]; [Dateformat setDateFormat:@"DD-MM-YYYY HH:mm:SS"]; NSMutableString *DateStr = [Dateformat stringFromDate:StrDate]; [UserCntrl.timeDisplay setText:DateStr];
This will call the updateTime method: once per second, updating your controller.
source share