Reputation: 181
I want to reload a UIWebView
(including all labels and images) when a button is tapped. How can I do that?
Upvotes: 10
Views: 32568
Reputation: 17317
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.
Upvotes: 5
Reputation: 2455
- (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]];
}
Upvotes: 35
Reputation: 26390
- (IBAction)buttonClicked
{
[yourWebview reload];
}
Hope this helps
Upvotes: 10