【发布时间】:2013-04-26 21:16:42
【问题描述】:
在我的AppDelegate我已经定义了
AppDelegate.h
@property (strong, nonatomic) NSTimer *notificationTimer;
AppDelegate.m
@synthesize notificationTimer = _notificationTimer;
- (void)applicationDidBecomeActive:(UIApplication *)application {
NSLog(@"applicationDidBecomeActive");
self.notificationTimer = [NSTimer timerWithTimeInterval:5
target:self
selector:@selector(checkForNotifications:)
userInfo:nil
repeats:YES];
[self.notificationTimer fire];
}
checkForNotifications: 被访问一次,但从不重复。为什么?
【问题讨论】:
标签: ios cocoa-touch nstimer appdelegate