我如何使用Apple Keychain? [英] How do I use Apple Keychain?
问题描述
我正在尝试使用 scifihifi-iphone(来自Github)存储和检索用户名和密码。但是,当我添加类 SFHFKeychainUtils
时,我收到以下错误:
I am using trying to use scifihifi-iphone (from Github) to store and retrieve usernames and passwords. However, when I add the class SFHFKeychainUtils
I get the following errors:
"_kSecAttrAccount", referenced from:
_kSecAttrAccount$non_lazy_ptr in SFHFKeychainUtils.o
"_SecItemDelete", referenced from:
+[SFHFKeychainUtils deleteItemForUsername:andServiceName:error:] in SFHFKeychainUtils.o
"_kSecReturnAttributes", referenced from:
_kSecReturnAttributes$non_lazy_ptr in SFHFKeychainUtils.o
"_kSecClass", referenced from:
_kSecClass$non_lazy_ptr in SFHFKeychainUtils.o
"_kSecClassGenericPassword", referenced from:
_kSecClassGenericPassword$non_lazy_ptr in SFHFKeychainUtils.o
"_SecItemAdd", referenced from:
+[SFHFKeychainUtils storeUsername:andPassword:forServiceName:updateExisting:error:] in SFHFKeychainUtils.o
"_kSecAttrLabel", referenced from:
_kSecAttrLabel$non_lazy_ptr in SFHFKeychainUtils.o
"_SecItemUpdate", referenced from:
+[SFHFKeychainUtils storeUsername:andPassword:forServiceName:updateExisting:error:] in SFHFKeychainUtils.o
"_kSecAttrService", referenced from:
_kSecAttrService$non_lazy_ptr in SFHFKeychainUtils.o
"_kSecReturnData", referenced from:
_kSecReturnData$non_lazy_ptr in SFHFKeychainUtils.o
"_SecItemCopyMatching", referenced from:
+[SFHFKeychainUtils getPasswordForUsername:andServiceName:error:] in SFHFKeychainUtils.o
+[SFHFKeychainUtils getPasswordForUsername:andServiceName:error:] in SFHFKeychainUtils.o
"_kSecValueData", referenced from:
_kSecValueData$non_lazy_ptr in SFHFKeychainUtils.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
我要遗漏什么?当我点击错误时,它不会把我带到代码中的任何地方。
What am I leaving out? When I click the errors, it doesn't take me to any place in the code.
推荐答案
添加 Security.framework
,然后重建。有时我发现我必须构建干净然后重建。
Add Security.framework
, then rebuild. Sometimes I find I have to build clean and then rebuild.
要添加它,右键单击Xcode中的目标,然后添加 - >现有框架并选择(或导航) )到 Security.framework
。
To add this, right click on your target in Xcode, then Add->Existing Frameworks and choose (or navigate) to Security.framework
.
这篇关于我如何使用Apple Keychain?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!