How to load a SplitViewController in a universal app

376 views Asked by At

This is probably a straight forward problem, but I for some reason cannot get it to work. I have an universal app, with icons on the start screen (TTLauncher) and use TTNavigator to push in view controllers.

On one of the icons a normal tableView is loaded (for the iPhone). As that is not nice for the iPad, I want to load that same tableView (if possible, as it has all the logic in it, I can adjust the code to include the required code for the splitview).

But how do I do that? I created a UIViewController (called SplitViewController), with a XIB in which I included the SplitViewController, and I made the class for the RootViewContorller of the splitview my custom TableViewController..

I thought it would work if I added the view to the TTNavigator, but nothing happens:

- (void)viewDidLoad
{
    [super viewDidLoad];
    NSLog(@"TEST!"); 
    TTNavigator* navigator = [TTNavigator navigator];
    [[navigator window] addSubview:splitViewController.view];  
}

(Test is called) I finally did try:

- (void)viewDidLoad
{
    [super viewDidLoad];  
    //[self setView:splitViewController.view];
    [window addSubview:splitViewController.view];

}

But still nothing happens. I think it is obvious that I don't understand how this works... Any tips? Or how can I better describe this, I assume, simple problem?

0

There are 0 answers