Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reload a UIWebView?

I want to reload a UIWebView (including all labels and images) when a button is tapped. How can I do that?

like image 281
Naresh Avatar asked May 04 '11 05:05

Naresh


2 Answers

Note that if you load the content of your UIWebView using loadHTMLString: then you'll need to call loadHTMLString: again to reload it. In this case the reload method doesn't work.

like image 190
ThomasW Avatar answered Oct 08 '22 17:10

ThomasW


- (void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
    [webView reload];
}

or

NSURL *theURL = [NSURL URLWithString:@"http://www.OurLovingMother.org/Mobile.aspx"];
    [webView loadRequest:[NSURLRequest requestWithURL:theURL]];
}
like image 36
vijay adhikari Avatar answered Oct 08 '22 17:10

vijay adhikari