mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 15:20:48 +00:00
Fix issues with controller instantiation
This commit is contained in:
parent
7d92caca6f
commit
41460c80c5
4 changed files with 150 additions and 102 deletions
|
@ -37,6 +37,7 @@
|
|||
#import "AppKit/NSViewController.h"
|
||||
#import "AppKit/NSStoryboardSegue.h"
|
||||
#import "AppKit/NSStoryboard.h"
|
||||
#import "AppKit/NSWindowController.h"
|
||||
|
||||
@interface NSStoryboardSegue (__ViewControllerPrivate__)
|
||||
- (void) _setDestinationController: (id)controller;
|
||||
|
@ -202,9 +203,17 @@
|
|||
{
|
||||
NSStoryboardSegue *segue = [_segueMap objectForKey: identifier];
|
||||
NSStoryboard *ms = [NSStoryboard mainStoryboard];
|
||||
NSString *destId = [segue destinationController];
|
||||
id destCon = [ms instantiateControllerWithIdentifier: destId];
|
||||
|
||||
id destCon = nil;
|
||||
if ([[segue destinationController] isKindOfClass: [NSViewController class]] ||
|
||||
[[segue destinationController] isKindOfClass: [NSWindowController class]])
|
||||
{
|
||||
destCon = [segue destinationController];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString *destId = [segue destinationController];
|
||||
destCon = [ms instantiateControllerWithIdentifier: destId];
|
||||
}
|
||||
[segue _setSourceController: self];
|
||||
[segue _setDestinationController: destCon]; // replace with actual controller...
|
||||
[self prepareForSegue: segue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue