Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Storyboard: Control-drag from a bar button to the Exit item

So I'm working on a new tutorial from Apple (https://developer.apple.com/library/ios/referencelibrary/GettingStarted/RoadMapiOS/SecondTutorial.html) and got to a point where I'm having a problem with the storyboard:

I cannot Control-drag from a UIBarButton to the Exit item in the scene dock. When I click on the Exit item the Attributes inspector says "Not Applicable".

Here is an extract of the tutorial. I am not able to post immages. For a better understanding of my problem you can see an image of the Control-drag to the Exit item at the bottom of the page.

To unwind back to XYZToDoListViewController

[...]

To create the unwind segue, link the Cancel and Done buttons to the unwindToList: action through the Exit icon in the dock of the source view controller, XYZAddToDoItemViewController.

To link buttons to the unwindToList: action

  • In the project navigator, select Main.storyboard.
  • On the canvas, Control-drag from the Cancel button to the Exit item in the add-to-do-item scene dock.
  • [...]
  • A menu appears in the location where the drag ended. Choose unwindToList: from the shortcut menu. This is the action you just added to the XYZToDoListViewController.m file. This means that when the Cancel button is tapped, the segue will unwind and this method will be called."
like image 467
captainqpeww Avatar asked Oct 23 '13 13:10

captainqpeww


1 Answers

You can only do this if you have a method that knows how to handle these events. This method has to have the following signature structure:

- (IBAction)finishedDoingWhatever:(UIStoryboardSegue *)sender;

Note that it has to be an IBAction and that it takes the segue as an argument. Once you do that, the popup should appear from the exit icon.

like image 89
Scott Berrevoets Avatar answered Sep 21 '22 00:09

Scott Berrevoets