My view controller sequence is as follows:
A -> (push) -> B -> (modal) -> C
I return from C to B using an unwind segue and it works.
I would like however to return directly from C to A.
In that unwind segue which is located in B, I try to pop to root view:
-(IBAction)unwindToBfromC:(UIStoryboardSegue *)segue
{
[self.navigationController popToRootViewControllerAnimated:YES];
}
and I get this error:
Tried to pop to a view controller that doesn't exist.
When I however execute:
[self.navigationController popToRootViewControllerAnimated:YES];
in B in a button action I return to A no problem. What's wrong?