adit
adit

Reputation: 33664

blank window with TTSplitViewController

I followed the same exact code as the TTCatalog example of TTSplitViewController, starting from the app delegate code, the TTSplitViewController code, and as well as the code for the TTTableViewController. However, when I run the apps I am getting a blank screen.

I started from a window based application and removed the nib file, as the example on TTCatalog doesn't have it.

What am I doing wrong here?

Here's some code, in my app delegate didFinishLaunchedWithOptions I have:

TTNavigator* navigator = [TTNavigator navigator];
    navigator.supportsShakeToReload = YES;
    navigator.persistenceMode = TTNavigatorPersistenceModeAll;

    TTURLMap* map = navigator.URLMap;
    [map from:@"*" toViewController:[TTWebController class]];


    if (TTIsPad()) {
        [map                    from: @"tt://catalog"
              toSharedViewController: [SplitViewController class]];

        SplitViewController* controller =
        (SplitViewController*)[[TTNavigator navigator] viewControllerForURL:@"tt://catalog"];
        TTDASSERT([controller isKindOfClass:[SplitViewController class]]);
        map = controller.rightNavigator.URLMap;

    }  

and everything else is similar to the TTCatalog example.

I was just wondering if anyone can give me a pointer on how to create a TTSplitViewController app, as this is quite frustrating. The example on the TTCatalog seems so simple, but when replicating it, everything fails.

For a full code, can be downloaded here

Upvotes: 2

Views: 262

Answers (1)

aporat
aporat

Reputation: 5932

If you created a project using a xcode template, it means your app delegate is loaded using a nib file. You will have to change it, because Three20 doesn't use nib files at all.

open the main.m file, and change:

int retVal = UIApplicationMain(argc, argv, nil, nil);

to

int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");

(Replace @"AppDelegate" with your UIApplicationDelegate class name. That should load your main window into the device.

Also note, that the TTSplitViewController class is a little buggy. I had to modify some code in three20 to make it work as it should. see https://github.com/aporat/three20-splitview-example if you want to try my version of TTSplitViewController.

Upvotes: 1

Related Questions