Reject multiple modal views without a navigation controller

I did not plan to properly view the navigation in my application, so the user can go through a cycle that simply stacks the modal views on top of each other, and from there the root view controller is accessible only through the time-consuming process of manually rejecting each re-view.

I can’t just go and use popToRootViewControllerAnimated:without a navigation controller on top of all this (calling presetModalViewController:animated:repeatedly seemed like a good idea at that time), so if there is something hiding Google from me, I'm completely lost.

Rewriting half of the navigation code is not perfect, but if this is really the only option, I will give it a chance.
Avoiding this would be preferable.

I don’t know what code would be useful, if any. It simply represents / rejects modal view controllers with multiple subclassesUIViewController

+3
source share
4 answers

OK, now I get it. Below the line is what I should never have done. Instead of trying to compose a loop created by loops, I just had to lock it to start.

That is, the Download button no longer generates another view. Instead, it rejects the current view, which can only be ever child of the Load view, creating the illusion of a new view and completely eliminating the problem of an uncontrollably growing stack.


Again, this is the wrong option:

, #define 'd if/else , .

- , , (/ ), . , ( , ), , .

0

A: ;

dismissModalViewController:animated: , .

B: ;

Navigation Controller, , , .

, , ([self.navigationController pushViewController: controller animated: YES]), ([self.navigationController popViewControllerAnimated: YES])

,

+2

@Grady . - rejectModalViewController: : :

, , , . , ; .

You should use -dismiss ... instead of popping the controller out of the navigation stack, since modal controllers may not even be part of the navigation stack. However, if you find that your application should be a navigation application, just take the time to do it. If this is a lot of work, perhaps it works, what needs to be done anyway.

+1
source

Change view property in your UIViewController not working?

0
source

All Articles