I got an answer. It's because you load data into the webView
without loadRequest
. If you load data
into webView
as a string, then it won't have any url
to go back or load the old page. So it won't store the data you given to the webView
. For that, you need to provide the url
as like this.
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"File name" ofType:@"html"] isDirectory:NO]]];