mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 15:11:37 +00:00
Simplify the code in doAction: when resolving the controller from it's id
This commit is contained in:
parent
9f04ad1b87
commit
4042a2550b
1 changed files with 5 additions and 10 deletions
|
@ -188,19 +188,14 @@
|
|||
|
||||
if (should)
|
||||
{
|
||||
id destCon = nil;
|
||||
if ([[_storyboardSegue destinationController] isKindOfClass: [NSViewController class]] ||
|
||||
[[_storyboardSegue destinationController] isKindOfClass: [NSWindowController class]])
|
||||
id destCon = [_storyboardSegue destinationController];
|
||||
if ([destCon isKindOfClass: [NSString class]])
|
||||
{
|
||||
destCon = [_storyboardSegue destinationController];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString *destId = [_storyboardSegue destinationController];
|
||||
destCon = [_storyboard instantiateControllerWithIdentifier: destId];
|
||||
// resolve the destination controller
|
||||
destCon = [_storyboard instantiateControllerWithIdentifier: destCon];
|
||||
[_storyboardSegue _setDestinationController: destCon]; // replace with actual controller...
|
||||
}
|
||||
[_storyboardSegue _setSourceController: _sender];
|
||||
[_storyboardSegue _setDestinationController: destCon]; // replace with actual controller...
|
||||
|
||||
if (_sender != nil &&
|
||||
[_sender respondsToSelector: @selector(performSegueWithIdentifier:sender:)])
|
||||
|
|
Loading…
Reference in a new issue