Я делаю тестовое приложение.Прямо сейчас у меня в приложении таймер didFinishLaunching
.
Вот мой код:
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{ timelabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 80, 280, 120)];
[self.view addSubview:timelabel];
[timelabel.text isEqualToString:@"0"];
time = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self
selector:@selector(timervoid) userInfo:nil repeats:YES];
}
-(void)timervoid {
int now;
now = [timelabel.text intValue];
int after;
after = now + 1;
timelabel.text = [NSString stringWithFormat:@"%i", after];
}
Мне нужен таймер для продолжения всех классов, поэтому я поместил его в приложение делегата приложения didFinishLaunching
, но как я могу добавитьэто по мнению класса?