Skip to content

Commit

Permalink
列出所有的通知,并且找到了合适的通知
Browse files Browse the repository at this point in the history
  • Loading branch information
studentdeng committed Feb 20, 2014
1 parent cadcdf8 commit 4aec0cf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Buddy/Buddy.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,23 @@ - (void)setup
name:NSWorkspaceDidDeactivateApplicationNotification
object:nil];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notificationLog:) name:nil object:nil];

[self goToOnline];

[self.onLineTimer invalidate];
self.onLineTimer = [NSTimer scheduledTimerWithTimeInterval:TIME_INTERVAL_MIN * 60 target:self selector:@selector(onLineTimerProc) userInfo:nil repeats:YES];
}

- (void)notificationLog:(NSNotification *)notify
{
if (![notify.name hasPrefix:@"IDEBuildOperation"]) {
return;
}

NSLog(@"%@", notify.name);
}

#pragma mark - time proc

- (void)onLineTimerProc
Expand Down

0 comments on commit 4aec0cf

Please sign in to comment.