views:

21

answers:

1

What is the save method for cocoatouch?

I need to add it where the comment is: // whatever you want to do.

- (BOOL) webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)ntype {
    if ([request.URL.scheme isEqualToString:@"hide"]) {
        // whatever you want to do.
    }

    return true;
}
+1  A: 

If you mean saving settings, you would usually use the NSUserDefaults.

[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"ShouldDoSomething"];

And to get it back

BOOL shouldDoSomething = [[NSUserDefaults standardUserDefaults] boolForKey:@"ShouldDoSomething"];

Obviously you can set other things aside from bools, see the documention on NSUserDefaults for more.

Tom Irving