popViewController not working

Related searches

I am having an issue with popViewController.

I use pushViewController to go to OrdersFormViewController

OrdersFormViewController *ordersFormViewController = [[OrdersFormViewController alloc] initWithNibName:@"OrdersFormViewController" bundle:nil];

[self.navigationController pushViewController:ordersFormViewController animated:YES];
[ordersFormViewController release];

From OrdersFormViewController I display a UIAlertView in viewDidLoad and call popViewController but this is not working.

UIAlertView* alertView = [[UIAlertView alloc]
                         initWithTitle:@"Error"
                         message:@"Error"
                         delegate:self
                         cancelButtonTitle:@"OK"
                         otherButtonTitles:nil];
[alertView show];
[alertView release];

[self.navigationController popViewControllerAnimated:YES];

The view is not "popped" from the navigationController but when pushing the standard back button in the navigation bar, only the navigation bar changes and not the actual view.

Does anyone have an idea why this is happening?

You should wait till the user dismisses the alert. This makes less confusion to the user.

You replied to my comment that it worked, for some magical reason I don't understand.

popViewController(animated: true) not working, let _ = navigationController?.popViewController(animated: true) is ignored however when I use picker.dismiss(animated: true, completion: nil)� poster doesn't understand difference between popToViewController and popViewController: iphone, ipad Navigationcontroller popToViewController not functioning poster is just asking how to popTo in general, not running into any problems with it: back to a particular view from any view in ios

I had a similar problem I fixed it by using

[self.parentViewController.navigationController popViewControllerAnimated:YES];

Hope that helps.

navigationController.popViewControllerAnimated does not work , Dismiss. Join GitHub today. GitHub is home to over 50 million developers working together to host and review code, manage projects, and� Re: iPhone X: popViewController in NavigationBar not working Level 1 (0 points) Snow Nov 29, 2017 1:31 AM ( in response to meyumeapps )

Not sure what you're trying to acomplish; but try adding it to viewDidAppear instead.

viewDidLoad may be getting called before you do the initial pushViewController call.

PopToRootViewController isn't work…, I've tried to push to the controller, and it works fine, so the problem does not seem to be with the button. It's the first view controller that is shown when the app is� PopViewController. I was following the exact step. However, it seemed popviewcontroller did not work. After 10s, it did not go back to inbox view controller. 1 Answer.

You should do all this in the -viewDidAppear: method. When called here, the animation sequence is currently in progress, and you controller will not have actually been animated onscreen yet. Wait until you've animated on screen, then dismiss yourself.

popViewController(animated:), popViewController(animated:) Pops the top view controller from the navigation stack and updates the display. Availability. iOS 2.0+; Mac Catalyst 13.0+; tvOS 9.0� This is why it is not possible to call popViewController on a UIViewController. Fourth lesson learned: PresentingViewController is a property provided by Apple that is available on both

If you created your project from master-detail template, remove the split view controller.

Pushing, Popping, Presenting, & Dismissing ViewControllers, This is why it is not possible to call popViewController on a UIViewController. Fourth lesson learned: PresentingViewController is a property� To receive the latest developer news, visit and subscribe to our News and Updates.

Another problem is that to use popViewController (animated:) you have to climb the view controller hierarchy, which is not a good practice, to call the method on the navigation controller. When a view controller is reachable in more than one way, you need to decide which method to use to go back .

In this method, I would need to return back to previous viewController. Unfortunately NavigationController.PopViewController(true); does not work here, as NavigationController does not exists in source class. Is there any method which would call my NavigationController?

Actually, if you connect the controller right now, the pc will not detect it Did you try to open the DS4 program in administrator mode? Right-click the program and go to Properties –> Shortcut. Go to Advanced. Check Run as Administrator checkbox. or You can also run a program in administrator mode directly from Start Menu.

Comments
  • You should wait till the user dismisses the alert. This makes less confusion to the user.
  • Good point! I implemented that and now it works. Thank you very much. I'm not sure what the policy is here. Maybe you should leave an answer which I can accept?
  • I've made it an answer, but actually it was a suggestion about user experience. Glad it worked :)
  • It worked for some reason. I am not sure either. If someone should see this thread in the future, the right approach seems to be to move it to viewDidAppear. This also works for me.
  • About the parentViewController: "Note that as of 5.0 this no longer will return the presenting view controller." :(
  • +1 You will definitely run into problems trying to pop a view controller before it has appeared.