I am a new iOS developer working on some legacy code. I learned from the code that to launch a new screen, I can do:
SomeViewController* view = [[SomeViewController alloc] initWithNibName:@"SomeViewController" bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:view animated:YES];
[view release];
I have a screen B is launched from screen A. I need to further launch a screen C from screen B. The flow is A -> B -> C. when I do B->C, the app freezes and the screen looks like this:
However when I do A->C, it's working perfectly. Has anyone seen this before? Really appreciate your help.
It's hard to tell what the true problem may be without seeing more code. However, I do notice two problems:
This was somewhat mentioned already in one of the comments. Pushing a UIView onto a UIViewController stack is an undifined action--you should be pushing a UIViewController. For example:
[self.navigationController pushViewController:myViewControllerForViewC animated:YES];
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.