将UITableView加载到另一个ViewController中的视图

Geo*_*egh 0 xcode objective-c storyboard uitableview xml-parsing

在我的storyboard文件中,我有2个viewcontrollers.一个UITableViewController和一个ViewController.我已经完成了所有这些所需的编码.但我需要在ViewController的视图中加载UITableView(及其数据).有什么建议?

Muh*_*ati 7

是的,你可以通过添加UItableViewController作为它的ChildViewController来做到这一点

UItableViewController*vc1 = [[test1 alloc]initWithNibName:@"SecondViewController" bundle:nil];

//add to the container vc which is self    
[self addChildViewController:vc1];

 //the entry view (will be removed from it superview later by the api)
 [self.view addSubview:vc1.view]; 
Run Code Online (Sandbox Code Playgroud)