Rui Lopes
Rui Lopes

Reputation: 2562

UISplitViewController - stack of UIViews

I have a problem in adapting my iPhone App to Universal. In my iPhone App, I have a tabBarController, with 5 tabs, each one with a tableView. I need now to adapt it to iPad, so I'm implementing the following: . A UISpliViewController, in which the rootViewController (left pane) is a tableView, to display in detailViewController (on the right side), each controller, corresponding to the tarBarController on the iPhone. So, my problem is where do I assign the controllers to the splitView? In AppDelegate? If I assign them in viewDidLoad on rootViewController, it don't work.

Anyone can help me? I'm stuck.

Thanks,

iChat: [email protected]

Upvotes: 0

Views: 420

Answers (3)

Rui Lopes
Rui Lopes

Reputation: 2562

I've done it. I've added 5 ViewControllers to the AppDelegate, and the problem is solved.

Thanks,

Rui

Upvotes: 0

Klu
Klu

Reputation: 56

create your splitview controller either in the xib or programmatically, then set the viewcontrollers

  splitViewController.viewControllers = [NSArray arrayWithObjects:leftViewController, rightViewController, nil];

in either method

- (void)applicationDidBecomeActive:(UIApplication *)application or 
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

Upvotes: 1

Bourne
Bourne

Reputation: 10312

In the AppDelegate's: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

method.

EDIT: Also see this SO post. Had bookmarked this when I started out.

UISplitViewController programmtically without nib/xib

Upvotes: 0

Related Questions