I have watched the apple demo video on storyboard implementation with the unwind segues section and seen the demo using custom buttons on the main view. That works fine.
I have also seen a good example of the same thing here which works also. http://www.techotopia.com/index.php/Using_Xcode_Storyboarding_%28iOS_6%29#Unwinding_Storyboard_Segues
However, I wish to have a normal push segue passing from parent (with main form data) to child (with advanced settings options) and then return to the parent view controller using the back button in the navigation bar rather than with a custom button on the view as shown in the demo. The parent controller will then save everything to an API server when a further save button on the parent controller is pressed.
I dont seem to be able to override the navigation back button to point it down to my unwind segue action and since the back button doesnt appear on the storyboard, I cant drag the green Exit button to it
I tried this in viewDidLoad to overrride the action, but it didnt work
[self.navigationItem.backBarButtonItem setAction:@selector(unwindSegueAction:)];
Is it possible to unwind a push segue with the back button?
The best idea I had so far was to override the back button from the viewDidLoad method, but that removes the angled back button style and also seems like a rough hack to a simple problem
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"back" style:UIBarButtonItemStyleBordered target:self action:@selector(unwindSegue:)];
I know there are answers for using protocol and delegates, but I am interested in using the Xcode4.5 unwind segue method
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…