user1487871
user1487871

Reputation: 11

disable refresh on back uiwebview

  1. I have a UIWebView and back button in it.
  2. when a user click back it refreshed the previous page.
  3. Is there a way to avoid this refresh? I want to show previous data with no change.

Upvotes: 1

Views: 1401

Answers (2)

ganesh manoj
ganesh manoj

Reputation: 977

I thinks its better to check your view will appear method in that view

Upvotes: 0

DarthMike
DarthMike

Reputation: 3481

You should cache the URLs, so no URL is requested again.

Creating a URL request, you supply the cache policy:

NSURLRequest * req = [NSURLRequest requestWithURL:@"" cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:10.0f];
[myWebView loadRequest:req];

Upvotes: 2

Related Questions