简体   繁体   中英

Using a push segue in StoryBoard, how to change to previous view

I am creating an app where if something occurs, it switches back to the previous screen.

There is practically no real code in the app, and when it does it has nothing to do with the previous view, but just in case, here is the entire .m: http://pastie.org/4111440

[self.navigationController popViewControllerAnimated:YES];

This^^ gives me EXC_BAD_ACCESS with "nested pop animation can result in corrupted navigation bar"

If you need any more info leave a comment. Thank you!

If you really want to help, I will message you a link to the entire .xcodepproj or whatever the extention is for the entire product.

I think the message says it all: "nested pop animation can result in corrupted navigation bar".

It looks like you are doing a pop with animation while in the middle of doing a pop with animation. I would recommend you figure out a different way to structure the code so you don't have the double pop.

If that's not possible, you may want to do a delayed pop to keep them from overlapping.

- (void)doPop
{
    [self.navigationController popViewControllerAnimated:YES];
}

…

// At the previous pop point.
[self performSelector:@selector(doPop) withObject:nil afterDelay:0.5];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM