开发者

how to access username/password application wide

开发者 https://www.devze.com 2023-01-16 19:41 出处:网络
I\'m using the SFHFKeychainUtils which is a wrapper for Apple开发者_JS百科\'s Keychain. To query a password I need a username.

I'm using the SFHFKeychainUtils which is a wrapper for Apple开发者_JS百科's Keychain. To query a password I need a username.

How can I access username application wide? Use a singleton? Other solutions?


Store the username (but not the password) in NSUserDefaults. Or, if you only have one user/pass pair, then you can just look at the appropriate attribute of the Keychain item.

0

精彩评论

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