For example, a tabbarcontroller, how can I get the corresponding navigation controller and table view controller of the next level of navigation in this controller?
Tabbar controller and navigation controller are essentially controllers of container class, which can hold multiple other controllers.If you want to get a controller of tabbar controller, you can use the property of selectedviewcontroller or the viewcontrollers property. This is an array. You can get all the controllers managed by tabbar controller.Navigation controller can use rootviewcontroller and topviewcontroller to get the top and bottom controllers, or use viewcontrollers property to get an array containing all view controllers
Yes, it is most convenient to use viewcontrollers. When traversing an array, you can use iskindofclass to determine whether it is an appropriate class or tag viewcontroller to get the desired VC