开发者

Save method in cocoatouch?

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:(UIWebViewNaviga开发者_如何学PythontionType)ntype {
    if ([request.URL.scheme isEqualToString:@"hide"]) {
        // whatever you want to do.
    }

    return true;
}


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜