首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用Apple Keychain?

如何使用Apple Keychain?
EN

Stack Overflow用户
提问于 2009-10-12 14:38:58
回答 1查看 13.5K关注 0票数 26

我正在尝试使用scifihifi-iphone (from Github)来存储和检索用户名和密码。但是,当我添加SFHFKeychainUtils类时,我得到以下错误:

代码语言:javascript
复制
  "_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

我遗漏了什么?当我单击错误时,它不会将我带到代码中的任何位置。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2009-10-12 15:58:17

添加Security.framework,然后重建。有时我发现我必须先构建干净,然后再重建。

要添加它,在Xcode中右键单击您的目标,然后添加->现有框架并选择(或导航)到Security.framework

票数 76
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1554954

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档