I am having a problems with the dismissViewControllerAnimated
method not closing down the view.
What is happening in the app here is:
ItemViewController
is selected.ItemDetailViewController
and details are sent through a delegateItemViewController
All of this works except for the View is not dismissed, there are no errors. Can anyone see what is wrong?
- (void)itemDetailViewControllerDidFinish:(ItemDetailViewController *)controller { NSLog(@"Controller: %@", controller); // Returns - Controller: <ItemDetailViewController: 0x6b68b60> [self dismissViewControllerAnimated:YES completion:nil]; }
When it comes time to dismiss a presented view controller, the preferred approach is to let the presenting view controller dismiss it. In other words, whenever possible, the same view controller that presented the view controller should also take responsibility for dismissing it.
What if you call [controller.navigationController popViewControllerAnimated:YES]
instead?
For that matter, what if you call [controller dismissViewControllerAnimated:YES completion:nil]
instead of calling it on self?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With