【发布时间】:2016-05-30 05:46:26
【问题描述】:
我想在特定时间禁用按钮:
我的问题
在时间到期之前,如果我移动到其他视图并返回相同的视图,按钮就会启用。
我的问题
如何在移动到其他视图时也禁用按钮?
我应用这段代码来实现我想要的..
UIBackgroundTaskIdentifier task =0;
UIApplication *app = [UIApplication sharedApplication];
task = [app beginBackgroundTaskWithExpirationHandler:^{[app endBackgroundTask:task]; }];NSTimer *timer;
timer = [NSTimer scheduledTimerWithTimeInterval:(0.25 * 60) target:self
selector:@selector(timerCountDown)userInfo:nil repeats:NO];
提前致谢..
【问题讨论】:
标签: ios iphone background uibutton nstimer