three20 TTNavigator演示代码触发编译器警告

问题描述:

我正在通过在TTNavigator演示应用程序之后创建一个类似的项目来工作,并已落在第一个障碍。three20 TTNavigator演示代码触发编译器警告

我已经重复起始段为显示在这里:

- (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"]]; 
    } 
} 

而且我已经包括了TabBarController但我得到一个编译器警告称控制器可以不setTabURLs回应。

我有复制粘贴控制器,无法看到问题出在哪里。

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

}

明白了!

确保这条线被列入Prefix.pch文件:-)

#import <Three20/Three20+Additions.h> 

或包括源代码!

+0

#进口什么(setTabUrls是在UIToolbarController一个类定义)? ? – oliland 2010-10-29 19:38:30

+0

-1请修复此问题或删除 - 没有帮助! – 2012-05-11 16:43:59

+0

好吧,我自己修复它,让你可以阅读它! – 2012-05-11 22:15:56

的OP指的是行是:

#import <Three20/Three20+Additions.h>

+0

+1谢谢 - 为什么例子不这样做是个谜! – 2012-05-11 16:42:51