I am right now making one application where in one page i am having navigation bar with back button and a uiwebview. on clicking a button,this page should be loaded. My problem is that when this page is loaded, it covers the whole page with the url passed and is not limited to that particular uiwebview. and as a result, i am not able to navigate to some other page.
I used the following code for the same :
- (void)viewWillAppear:(BOOL)animated
{
NSString *url = [NSString stringWithFormat:@"http://www.facebook.com/"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]];
[webview loadRequest:request];
[super viewWillAppear:animated];
}
Can anybody answer me,how to ressolve this problem?
Thanks in advance.
When you use:
[[UIApplication sharedApplication] openURL...it’s calling safari to open the url, after it closes your app.So, create a WebViewController and in the
viewDidLoadadd the following:and in the root controller’s button add this to the action:
And of course for WebViewController header, you need:
and dont forget to
@synthesize siteType,webView;