I am new to ipad development. In my application i have created splitview like the below image. In this how can i c开发者_运维技巧all another detailview controller when tabbar on the left pane selection changes??
Please help me..
You can simply replace the VC at index 1 of the UISplitViewController's viewControllers property. Try something like-
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
UIViewController* myReplacementVC = nil;
if(viewController == VC1)
myReplacementVC = myReplacementVC1;
else
myReplacementVC = myReplacementVC2;
NSMutableArray* arr = [[NSMutableArray alloc] initWithArray:splitVC.viewControllers];
[arr replaceObjectAtIndex:1 withObject:myReplacementVC]; //index 1 corresponds to the detail VC
splitVC.viewControllers = arr;
[arr release];
}
This addressed the issue for me:
http://developer.apple.com/library/ios/#samplecode/MultipleDetailViews/Introduction/Intro.html#//apple_ref/doc/uid/DTS40009775-Intro-DontLinkElementID_2
and with Storyboards
http://www.raywenderlich.com/forums/viewtopic.php?f=2&t=1546
精彩评论