Created
November 12, 2011 12:27
-
-
Save mikeabdullah/1360468 to your computer and use it in GitHub Desktop.
Restoring an optional, secondary document window
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)restoreDocumentWindowWithIdentifier:(NSString *)identifier state:(NSCoder *)state completionHandler:(void (^)(NSWindow *, NSError *))completionHandler; | |
{ | |
if ([identifier isEqualToString:@"Secondary"]) | |
{ | |
// Rely on main controller to create secondary window | |
if (![[self windowControllers] count]) [self makeWindowControllers]; | |
MyWindowController *mainController = [[self windowControllers] objectAtIndex:0]; | |
completionHandler([[mainController secondaryWindowController] window], nil); | |
} | |
else | |
{ | |
[super restoreDocumentWindowWithIdentifier:identifier state:state completionHandler:completionHandler]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment