mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 15:20:48 +00:00
Centralize logic for resolution of destination controller
This commit is contained in:
parent
c981f533df
commit
f1a3e5dea6
5 changed files with 30 additions and 72 deletions
|
@ -196,29 +196,10 @@
|
|||
- (void)performSegueWithIdentifier: (NSStoryboardSegueIdentifier)identifier
|
||||
sender: (id)sender
|
||||
{
|
||||
BOOL should = [self shouldPerformSegueWithIdentifier: identifier
|
||||
sender: sender];
|
||||
|
||||
if (should)
|
||||
{
|
||||
NSStoryboardSegue *segue = [_segueMap objectForKey: identifier];
|
||||
id destCon = nil;
|
||||
if ([[segue destinationController] isKindOfClass: [NSViewController class]] ||
|
||||
[[segue destinationController] isKindOfClass: [NSWindowController class]])
|
||||
{
|
||||
destCon = [segue destinationController];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString *destId = [segue destinationController];
|
||||
destCon = [_storyboard instantiateControllerWithIdentifier: destId];
|
||||
}
|
||||
[segue _setSourceController: self];
|
||||
[segue _setDestinationController: destCon]; // replace with actual controller...
|
||||
[self prepareForSegue: segue
|
||||
sender: sender];
|
||||
[segue perform];
|
||||
}
|
||||
NSStoryboardSegue *segue = [_segueMap objectForKey: identifier];
|
||||
[self prepareForSegue: segue
|
||||
sender: sender];
|
||||
[segue perform];
|
||||
}
|
||||
|
||||
- (void)prepareForSegue: (NSStoryboardSegue *)segue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue