有人使用Buzz Andersen的Simple iPhone钥匙串代码吗? [英] Has anyone used Buzz Andersen's Simple iPhone Keychain code?

查看:81
本文介绍了有人使用Buzz Andersen的Simple iPhone钥匙串代码吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可以在这里找到它.

我试图理解他的示例代码,以便编写一个简单的程序,将密码存储到钥匙串中并检索它们以进行登录.有人做过吗?如果能看到您可能有的任何示例,将不胜感激.

I'm trying to understand his sample code in order to write a simple program with that stores passwords into the keychain and retrieves them for login. Has anyone done this before? It would be most appreciated if I can see any examples you may have.

推荐答案

实际上没有可演示的代码,他在那里列出了两个调用.

There's really no code to demonstrate, he lists both calls there.

这里是一个例子,说明了它的价值:

Heres's an example, for what it is worth:

NSError *error;

[SFHFKeychainUtils storeUsername:@"fred" andPassword:@"mypassword123" forServiceName:@"myService" updateExisting:YES error:&error];

NSString *storedPassword = [SFHFKeychainUtils getPasswordForUsername:@"fred" andServiceName:@"myService" error:&error];

这篇关于有人使用Buzz Andersen的Simple iPhone钥匙串代码吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆