在我的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:
达到一次但从不重复。为什么?