itdeeps
itdeeps

Reputation: 277

UITabbarController in UiSplitViewController

I am new to ipad development. I am developing an ipad application similar to the following apps:

http://itunes.apple.com/us/app/dropbox/id327630330?mt=8

http://itunes.apple.com/in/app/box.net/id290853822?mt=8...

In both these apps structure looks like uitabbarcontroller integrated inside uisplitviewcontroller. But i ve heard that uisplitviewcontroller cannot be a rootviewcontroller. Then how these apps designed??? How to do a structure like that???

Upvotes: 2

Views: 2531

Answers (1)

tipycalFlow
tipycalFlow

Reputation: 7644

You're right that uisplitviewcontroller cannot be a rootviewcontroller. So, it has to be added as a subview as follows:

- (BOOL)application:(UIApplication *)app didFinishLaunchingWithOptions:(NSDictionary *)options {
UIViewController *vc1 = [[CalculatorViewController alloc] init]; 
UIViewController *vc2 = [[GraphViewController alloc] init];
UISplitViewController*svc=[[UISplitViewControlleralloc]init];
svc.viewControllers = [NSArray arrayWithObjects:vc1, vc2, nil];
[vc1 release];  [vc2 release];
[window addSubview:svc.view]; 
[window makeKeyAndVisible]; 
return YES;}

Check out this sample available at developer.apple.com

Upvotes: 1

Related Questions