16
votes

I add a an action method to view controller and Ctrl-Drag the button to Exit icon in storyboard,and the unwind segue is created successfully.But when I touch the button, the unwind segue doesn't work(the current scene doesn't navigate to original scene) and the action method isn't triggered.I don't know why.

here is the action method

@interface HMCViewController2 : UIViewController
-(IBAction)return:(UIStoryboardSegue *)segue;
@end

@implementation HMCViewController2
...
-(IBAction)return:(UIStoryboardSegue *)segue{

}

@end

I upload the project to google drive.

1

1 Answers

49
votes

You have put your unwind segue code in the wrong viewController. It should be located in the controller you wish to unwind TO, not the controller you are returning FROM.