我希望在分段控件的索引发生变化时更改容器视图。我尝试在之前设置/更改容器:
-(void)viewDidLoad {
[super viewDidLoad];
ResMainViewController *newVC = [[ResMainViewController alloc]initWithClassName:@"ResMainViewController"];
[self addChildViewController:newVC];
// Add the new view controller view to the ciew hierarchy
[self.containerView addSubview:newVC.view];
// End the view controller transition
[newVC didMoveToParentViewController:self];
// Store a reference to the current controller
self.containerView = newVC.view;
}
然而,这不起作用。我可以从tableView接收日志,但tableview(单元格)中没有任何内容。我什么都没有错过?请帮助!!!