Problem with TTWebController… alternative view controller template for UIWebView?
Posted
by prendio2
on Stack Overflow
See other posts from Stack Overflow
or by prendio2
Published on 2010-04-12T21:43:47Z
Indexed on
2010/04/12
22:33 UTC
Read the original article
Hit count: 330
I have a UIWebView with content populated from a Last.fm API call.
This content contains links, many of which are handled by parsing info from the URL in:
- (BOOL)webView:(UIWebView *)aWbView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType;
…and passing that info on to appropraite view controllers.
When I cannot handle a URL I would like to push a new view controller on the stack and load the webpage into a UIWebView there.
The TTWebController in Three20 looks very promising since it has also implemented a navigation toolbar, loading indicators etc.
Somewhat naively perhaps I thought I would be able to use this controller to display web content in my app, without implementing Three20 throughout the app. I followed the instructions on github to add Three20 to my project and added the following code to deal with URLs in shouldStartLoadWithRequest:
TTWebController* browser = [[TTWebController alloc]init];
[browser openURL:@"http://three20.info"]; //initially test with this URL
[self.navigationController pushViewController:navigator animated:YES];
This crashes my app however with the following notice:
*** -[TTNavigator setParentViewController:]: unrecognized selector sent to instance 0x3d5db70
What else do I need to do to implement the TTWebController in my app?
Or do you know of an alternative view controller template that I can use instead of the Three20 implementation?
© Stack Overflow or respective owner