I have code to fetch the perticular childviewcontroller of navigation controller.
NSArray *contllrs = [self.navigationController childViewControllers];
NSLog(@"controllers : %@",contllrs);
if([contllrs count]>3)
[self.navigationController popToViewController:[contllrs objectAtIndex:0] animated:YES];
It gives log as
childviewcontrollers : NSHashTable (%@) {
[3] <abcVC: 0x1dc1d0>
[4] <defVC: 0x5daf790>
[7] <efgVC: 0x1724a0>
[10] <adsfVC: 0x1b14f0>
[11] <SdfVC: 0x1e2c30>
}
Crashes with
InvalidArgument
This works fine with iPad simulator but crashes on iPad
Try to use the below code: