获取控制器 思路总结

1.   在利用导航控制器时,从栈中获取:

UIResponder *responder = self.当前视图;

 while ((responder = [responder nextResponder])){
        if ([responder isKindOfClass: [UIViewController class]]){
          UIViewController *ui =   (UIViewController *)responder;
           [ui.navigationController pushViewController:contentImageController animated:YES];;
        }
    }


2.  根据storyboard里设置storyboard ID来获取该视图

        UIStoryboard *mainBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];

        GroupDetailViewController *groupDetailViewController = [mainBoard instantiateViewControllerWithIdentifier:@"GroupDetailInfoStoryboardID"];


你可能感兴趣的:(获取控制器 思路总结)