I am using UIWebView as a web browser on my application and when I open an url with my browser and return back to the main view, then go to browser view, my webview doesn't save the content. So, if I go to google.com and switch views, then again go to the browser view, I have to type the url again to open the webpage! How can I save the web browser's content?
+1
A:
- (void)viewDidUnload method of UIWebView save the url in AppDelagate's variable(NSString say for example NSString *lastURL) and in ViewDidLoad of UIwebView check for that variable(lastURL) if it contains some value than load the webview with that URL... Simple...
mihirpmehta
2010-05-14 11:51:21
thank you but iam amateur iphone programming can you help me more ?
Momeks
2010-05-14 13:28:06
from this answer what exactly is not understood by you... ?
mihirpmehta
2010-05-15 05:20:40
to creat lastURL and store the web view link on it
Momeks
2010-05-15 14:33:06
In your UIWebView's Class there should be one method viewDidUnload inside that assign UIWebView's current URl to lastURL... inside ViewWillAppear method check lastURL if it contains some value than load your webview with lastURL... (initally lastURL would be nil)
mihirpmehta
2010-05-17 04:33:54