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

发布于 2024-09-14 12:02:22 字数 1253 浏览 3 评论 0原文

我正在按照 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]];

}

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]];

}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无声情话 2024-09-21 12:02:22

OP所指的行是:

#import

(setTabUrls:在UIToolbarController上的类别中定义)

the line the OP was referring to is:

#import <Three20/Three20+Additions.h>

(setTabUrls: is defined in a category on UIToolbarController)

早茶月光 2024-09-21 12:02:22

知道了!

确保此行包含在 Prefix.pch 文件中:-)

 #import <Three20/Three20+Additions.h>

或包含在源代码中!

Got it!

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

 #import <Three20/Three20+Additions.h>

or include in source code!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文