mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 15:11:37 +00:00
Check if the _sender responds to performSegueWithIdentifier:sender:
This commit is contained in:
parent
3b4b1b42d5
commit
9eb278c560
1 changed files with 3 additions and 3 deletions
|
@ -180,8 +180,7 @@
|
|||
// If the instance we are testing is a controller, then the value of should is set by this method....
|
||||
// if it is not, as it is possible to initiate a segue from an NSMenuItem, then we don't, but should
|
||||
// remains set to YES so that the logic to replace the destination controller is still called.
|
||||
if ([_sender respondsToSelector: @selector(shouldPerformSegueWithIdentifier:sender:)] &&
|
||||
([_sender isKindOfClass: [NSViewController class]] || [_sender isKindOfClass: [NSWindowController class]]))
|
||||
if ([_sender respondsToSelector: @selector(shouldPerformSegueWithIdentifier:sender:)])
|
||||
{
|
||||
should = [_sender shouldPerformSegueWithIdentifier: _identifier
|
||||
sender: _sender];
|
||||
|
@ -203,7 +202,8 @@
|
|||
[_storyboardSegue _setSourceController: _sender];
|
||||
[_storyboardSegue _setDestinationController: destCon]; // replace with actual controller...
|
||||
|
||||
if (_sender != nil)
|
||||
if (_sender != nil &&
|
||||
[_sender respondsToSelector: @selector(performSegueWithIdentifier:sender:)])
|
||||
{
|
||||
[_sender performSegueWithIdentifier: _identifier
|
||||
sender: _sender];
|
||||
|
|
Loading…
Reference in a new issue