I have inherited my ViewController from BaseViewController and I have pushed my SecondViewController using storyboard ID.but, when I am trying to popview from second view to view controller its not working. Here is my code:
dispatch_async(dispatch_get_main_queue(), ^{
[self showMesssgeonAlert:@"Success"];
[self hideProgress];
[self.navigationController popViewControllerAnimated:TRUE];
});
Even i tried with :
NSArray *controllerArray = self.navigationController.viewControllers;
for (id controller in controllerArray)
{
if ([controller isKindOfClass:[ViewController class]])
{
[self.navigationController popViewControllerAnimated:TRUE];
}
}
but,its not working in both the conditions.What should I do?Please help me.
Make sure you are pushing the controller SecondViewController on ViewController, If you are using segue then check the show type like (Push, Present Modally). If this is correct then check the navigation controller object, it should have an object.
Finally check the memory address of navigation controller in both the view controllers did load method. It should same.