2011-03-03 59 views
0

我已經實現這個URL映射一個TTNavigator:TTNavigator:如何將參數傳遞給自定義的UIWebView?

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

那麼,當啓動的項目的電話:

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

我CustomWebController不顯示..我怎麼可以叫 「的loadView」內部???

感謝您的幫助

回答

0

而不是試圖在URL作爲TTURL一個參數去傳遞,我想你可能會發現它更容易地創建一個類,它擴展TTWebController,將允許你做任何你需要的自定義去做。然後,你將映射的網址時,你要到該網頁加載了您的自定義控制器

所以,你的新類將是這樣的:

@interface CustomWebController : TTWebController { 
} 

@end 

@implementation CustomWebController 
    // Customizations 
} 

@end 

,然後您將添加一個映射到你的TTURLMap

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

和你的啓動程序項

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