I have a question regarding storyboard segues. Platform is iOS 6.1. Target device is iPhone. IDE is Xcode 4.5.2. What I have are 2 TableViewControllers, both of which have a
When you push a view controller using a Navigation view controller, it will be pushed on the top of a stack with view controllers.
So all you have to do get back to the previous view controller is to pop the one that got pushed.
Put this in your IBAction method:
[self.navigationController popViewControllerAnimated:YES];
Now, if you really want to know what segue that was used, you can just pass the segue identifier to the destination controller, and put it in a property like this:
-(void)prepareForSegue:(UIStoryboardSegue*)segue sender:(id)sender
{
if([[segue identifier] isEqualToString:@"segOne"])
{
MyOtherViewController *other = (MyOtherViewController *)segue.destinationViewController;
other.theSegueIUsed = @"segOne";
}
}
You also need to add the property to the other view controllers header file:
@property (strong, nonatomic)NSString *theSegueIUsed;