0

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: rui.lopes@me.com

Rui Lopes
  • 2,562
  • 6
  • 34
  • 49

3 Answers3

1

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
Klu
  • 56
  • 6
0

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

Community
  • 1
  • 1
Bourne
  • 10,094
  • 5
  • 24
  • 51
  • the problem is that i have it built in xib, so i don't need to alloc and init the splitViewController. Can we talk in iChat or Skype? I'm going crazy today... :( – Rui Lopes Mar 08 '11 at 19:20
  • Go to developer documentation on Xcode and search for "MultipleDetailViews" and open that project and study it. Let me know if that clears up your nib/xib based uisplitviewcontroller issues. – Bourne Mar 08 '11 at 19:29
  • hi, i've studied it, but my problem is: i need do init all 5 viewControllers at startup, and then show them when the user taps each row on the rootViewController. How can I do it? In the - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOption Or just after I add the splitViewController to the window? Can we speek on iChat or Skype? – Rui Lopes Mar 08 '11 at 21:27
0

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

Thanks,

Rui

Rui Lopes
  • 2,562
  • 6
  • 34
  • 49