标签:
1 - (void)delayEnableTabButton 2 { 3 self.tabChannelButton.enabled = NO; 4 [self appendTimer]; 5 } 6 7 - (void)appendTimer 8 { 9 if (_resumeTimer == nil) 10 { 11 _resumeTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(enableTabChannelButton) userInfo:nil repeats:NO]; 12 } 13 } 14 15 - (void)enableTabChannelButton 16 { 17 self.tabChannelButton.enabled = YES; 18 [self removeTimer]; 19 } 20 21 - (void)removeTimer 22 { 23 if (_resumeTimer != nil) 24 { 25 [_resumeTimer invalidate]; 26 _resumeTimer = nil; 27 } 28 } 29 30 31 - (void)dealloc 32 { 33 [self removeTimer]; 34 }
标签:
原文地址:http://www.cnblogs.com/lz465350/p/5477276.html