开发者

TTNavigator: How to pass a parameter to a custom UIWebView?

I have implemented a TTNavigator with this url map:

TTNavigator* navigator = [TTNavigator navigator];
navigator.persistenceMode = TTNavigatorPersistenceModeNone;
TTURLMap* map = navigator.URLMap;
[map from:@"tt://launcher/" toViewController:   [LauncherViewController class]];
[map from:@"tt://onlineCall/(callOnlineURL:)" toViewController: [CustomWebController class]];

Well, when 开发者_运维技巧a call by Launcher's item:

item =
[[TTLauncherItem alloc] initWithTitle: @"Online"
                                image: @"bundle://safari_logo.png"
                                  URL: @"tt://onlineCall/www.google.it"];
[launcherView addItem:item animated:YES];

my CustomWebController doesn't show.. how i can call "loadView" internally ???

thanks for help


Instead of trying to pass in the URL as a param in the TTURL, I think you might find it easier to create a class that extends TTWebController that would allow you to do whatever customizations you need to do. Then you would map the web URLs you want to go to that page to load up your custom controller

So your new class would like this:

@interface CustomWebController : TTWebController {
}

@end

@implementation CustomWebController
    // Customizations
}

@end

and then you would add a mapping to your TTURLMap

[map from:@"www.google.it" toViewController: [CustomWebController class]];

and your launcher item

[[TTLauncherItem alloc] initWithTitle: @"Online"
                        image: @"bundle://safari_logo.png"
                        URL: @"www.google.it"];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜