Reputation: 540
My view controller (A) issues a perform modal segue to view controller (B). The subsequent unwind segue action issues a second perform modal segue to what I expect to be another instance of the same view controller (B). That is, I want (B) to do it's thing a second time independent of the first segue to (B). While prepareForSegue is called a second time, the second segue is never executed. View (B) hangs around until the unwind segue action and the methods it calls complete, and the second perform segue and prepareForSegue are ignored.
The only way I can think to avoid this problem is to issue a perform block after a delay allowing the return segue et. al. to go to completion.
Is there a better way?
Thanks
Upvotes: 2
Views: 101
Reputation: 540
I don't understand why this happens, but now it works. I have done nothing since yesterday other than add a few breakpoints. This is not the first time adding breakpoints seems to fix a problem.
Upvotes: 0
Reputation: 1194
If I understand, you are calling the segue to B from view controller B like so?
- (IBAction)unwindToThisViewController:(UIStoryboardSegue *)unwindSegue
{
// Code
[self performSegueWithIdentifier:@"segueToB"];
}
You can't go to view B because you are already there. You will need to wait until B has been fully dismissed and call it from view A.
Upvotes: 0