lundi 27 avril 2015

get view controller stack from storyboard


I try to get view-controllers array of Navigation Controller.It will returns blank array as shown below:

   UIStoryboard *mystoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPad" bundle:nil]; 
UINavigationController *nav1 = [mystoryboard instantiateViewControllerWithIdentifier:@"nav1"];
 NSLog(@"%@",nav1.viewControllers);

but this displays empty array even though it has view controller.

Thanks in advance


Aucun commentaire:

Enregistrer un commentaire