开发者

three20 TTNavigator demo code triggers a compiler warning

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)app开发者_JAVA技巧licationDidFinishLaunching:(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]];

}


the line the OP was referring to is:

#import <Three20/Three20+Additions.h>

(setTabUrls: is defined in a category on UIToolbarController)


Got it!

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

 #import <Three20/Three20+Additions.h>

or include in source code!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜