在我UIViewControllers
的{{1}}之一中,我这样做了:
UITabBarController
但我在for ... line上发出警告说:
集合表达式类型MyTabBarController可能无法响应countByEnumeratingWithState:objects:count。
MyTabBarController *myTBC = (MyTabBarController*)self.parentViewController;
for(UIViewController *anyVC in myTBC) {
if([anyVC.class isKindOfClass:[SecondViewController class]])
sVC = (SecondViewController *)anyVC;
sVC.userLocation = userLocation;
}
是MyTabBarController
的子类。
答案 0 :(得分:0)
这一行:
for(UIViewController *anyVC in myTBC) {
应该是:
for(UIViewController *anyVC in myTBC.viewControllers) {