So what I need help with is to like make tabs. In which after the app is terminated then the user will be able to see the last URL they were at. But this code is not working.
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
[[NSUserDefaults standardUserDefaults] saveObject: [[request URL] absoluteString] forKey: @"SAVED-URL"];
}
Use the webview delegate to retrieve the last request.
– webView:shouldStartLoadWithRequest:navigationType:http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebViewDelegate_Protocol/Reference/Reference.html
Save it eg. to the userdefaults like that:
[[NSUserDefaults standardUserDefaults] saveObject: [[request URL] absoluteString] forKey: @"SAVED-URL"];https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/nsuserdefaults_Class/Reference/Reference.html
After the app restarted, load it again from the Userdefaults and load it up in the webview.