Skip to content
This repository has been archived by the owner on Sep 4, 2018. It is now read-only.

Subscribe to Xcode launch notification synchronously #382

Merged
merged 1 commit into from
Nov 13, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions Alcatraz/Alcatraz.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,22 @@ + (NSString *)localizedStringForKey:(NSString *)key {
- (id)initWithBundle:(NSBundle *)plugin {
if (self = [super init]) {
self.bundle = plugin;
[[NSOperationQueue mainQueue] addOperationWithBlock:^{

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(xcodeDidFinishLaunching:)
name:NSApplicationDidFinishLaunchingNotification
object:nil];
}];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(xcodeDidFinishLaunching:)
name:NSApplicationDidFinishLaunchingNotification
object:nil];
[self updateAlcatraz];
}
return self;
}

- (void) xcodeDidFinishLaunching: (NSNotification *) notification {
[self createMenuItem];

- (void)xcodeDidFinishLaunching: (NSNotification *) notification {
[[NSNotificationCenter defaultCenter] removeObserver:self
name:NSApplicationDidFinishLaunchingNotification
object:nil];
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
[self createMenuItem];
}];
}

#pragma mark - Private
Expand Down