Three20 TTNavigator 演示代码触发编译器警告
我正在按照 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
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)
知道了!
确保此行包含在 Prefix.pch 文件中:-)
或包含在源代码中!
Got it!
make sure this line is included in the Prefix.pch file :-)
or include in source code!