Search code examples
objective-cuiviewcontrolleruinavigationcontrollernsarrayios11

Not able to navigate from one Particular screen issue is only in iOS 11


The app is navigating to VC1 to VC2, in VC2 "Back", "Menu" & "Submit" Button are there on click of "Submit" displaying one alert with message and "Ok" button on click of "Ok" button I'm trying to pop to VC1, code is executing but navigation is not happening.

Same is happening for "Back" & "Menu" Buttons also code is executing but not navigating to any other pages. Using Xcode 9 beta 6.

The below piece of code I'm using in my project

NSArray *controllersArray = [[self navigationController] viewControllers];

        for(UIViewController *controller in controllersArray)
        {
            if ([controller isKindOfClass:[ViewController1 class]])
            {
                ViewController1 *accDetailVC = (ViewController1*)controller;
                [[self navigationController] popToViewController:accDetailVC animated:YES];
                break;
            }
        }

working in other iOS versions except for iOS 11 beta. Please help me on this if any one is facing the same issue.


Solution

  • Issue got fixed while pushing from VC1 to VC2 before I'm using [[self navigationController] pushViewController:ctrl animated:YES] now changed as [[self navigationController] pushViewController:ctrl animated:NO]