Naresh
Naresh

Reputation: 181

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?

Upvotes: 10

Views: 32568

Answers (4)

ThomasW
ThomasW

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

vijay adhikari
vijay adhikari

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

visakh7
visakh7

Reputation: 26390

- (IBAction)buttonClicked
{
   [yourWebview reload];
}

Hope this helps

Upvotes: 10

Krishna
Krishna

Reputation: 1871

You can try

[webView reload];

in your click handler.

Upvotes: 3

Related Questions