Has anyone used Buzz Andersen's Simple iPhone Keychain code?

不想你离开。 提交于 2019-12-06 05:34:30

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];

To other newbies that use this code as is and don't understand why it doesn't work. Notice that the ServiceName is different (First without capital - "myService" and second with capital: "MyService"), that's why it doesn't work. Make the ServiceName the same.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!