是否有出路或任何人都可以指向我的链接,我正在寻找在选择detailViewController中的任何按钮时在SPLITVIEW的IPAD中更改RootViewController的内容?
答案 0 :(得分:1)
您可以简单地替换UISplitViewController的viewControllers属性的索引0处的VC。尝试像 -
这样的东西-(void) buttonPressed: (id)sender
{
NSMutableArray* arr = [[NSMutableArray alloc] initWithArray:splitVC.viewControllers];
[arr replaceObjectAtIndex:0 withObject:myReplacementVC]; //index 0 corresponds to the left VC
splitVC.viewControllers = arr;
[arr release];
}
HTH,
阿克沙伊
答案 1 :(得分:0)
SplitViewController的内容可以像这样更改:
UISplitViewController * splitViewController = [[UISplitViewController alloc] init];
splitViewController.viewControllers = [NSArray arrayWithObjects:viewControllerLeft, viewControllerRight, nil];
// the other stuff
// change left part of view controller
splitViewController.viewControllers = [NSArray arrayWithObjects:newViewController, viewControllerRight, nil];