Skip to content

Commit

Permalink
NSApp/sharedApplication and the app delegate.
Browse files Browse the repository at this point in the history
The proper fix - instead of (invalid) cast sharedApplication must be used.
NSApp is "id" and compiler failed to find anything except stupid setDelegate:id<BLABLA>,
it does not mean we have to cast to BLABLA.
  • Loading branch information
TimurP committed Nov 3, 2014
1 parent 60bf915 commit 4bb93b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion graf2d/cocoa/src/ROOTApplicationDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ @implementation ROOTApplicationDelegate
- (id) init
{
if (self = [super init])
[NSApp setDelegate : (id<NSFileManagerDelegate>)self];
[[NSApplication sharedApplication] setDelegate : self];

return self;
}
Expand Down
2 changes: 1 addition & 1 deletion rootx/src/rootxx-cocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ void WaitLogo()

if (showAboutInfo) {
delegate = [[ROOTSplashScreenAppDelegate alloc] init];
[NSApp setDelegate : (id<NSFileManagerDelegate>)delegate];
[[NSApplication sharedApplication] setDelegate : delegate];
}

RunEventLoop();
Expand Down

0 comments on commit 4bb93b6

Please sign in to comment.