three20 TTNavigator demo code triggers a compiler warning

1.5k views Asked by At

I am working through creating a similar project following the TTNavigator demo app and have fallen at the first hurdle.

I have duplicated the beginning section as show here:

- (void)applicationDidFinishLaunching:(UIApplication *)application {
     TTNavigator* navigator = [TTNavigator navigator];
     navigator.persistenceMode = TTNavigatorPersistenceModeAll;
     navigator.window = [[[UIWindow alloc] initWithFrame:TTScreenBounds()] autorelease];
     TTURLMap* map = navigator.URLMap;
     [map from:@"*" toViewController:[TTWebController class]];
     [map from:@"tt://tabBar" toSharedViewController:[TabBarController class]];
     if (![navigator restoreViewControllers]) {
      [navigator openURLAction:[TTURLAction actionWithURLPath:@"tt://tabBar"]];
     }
}

And I have included the TabBarController but I get a compiler warning saying the controller may not respond to setTabURLs.

I have copy-pasted the controller and can't see where the problem is.

- (void)viewDidLoad {
  [self setTabURLs:[NSArray arrayWithObjects:@"tt://menu/1",
                                             @"tt://menu/2",
                                             @"tt://menu/3",
                                             @"tt://menu/4",
                                             @"tt://menu/5",
                                             nil]];

}

2

There are 2 answers

1
user7865437 On

Got it!

make sure this line is included in the Prefix.pch file :-)

 #import <Three20/Three20+Additions.h>

or include in source code!

0
TomL On

the line the OP was referring to is:

#import <Three20/Three20+Additions.h>

(setTabUrls: is defined in a category on UIToolbarController)