![](/img/trans.png)
[英]Couldn't add the Keychain Item. Error - 25299 after change the identifier with KeychainItemWrapper?
[英]KeychainItemWrapper 'Couldn't add the Keychain Item.'
我想將訪問令牌存儲到鑰匙串。 但是我得到了錯誤: Couldn't add the Keychain Item.'
我檢查了stackoverflow上的一些帖子,如: 在keychain中存儲電子郵件不可能(KeychainItemWrapper)
mycode的:
let a = NSKeyedArchiver.archivedData(withRootObject: "980a872c17a075367357e25e88c1c0476417092a")
let keyWrapper = KeychainItemWrapper.init(identifier: "23123123", accessGroup: nil)
keyWrapper?.setObject(a, forKey: kSecValueData)
我嘗試添加這個
keyWrapper?.setObject(kSecAttrAccessible, forKey: kSecAttrAccessible)
更改kSecValueData
到kSecAttrGeneric
我正在使用swift 3.0運行Xcode 8。 任何提示都謝謝你!
編輯 ===========================
Viruss mca的回答開啟共享鑰匙串權利只為我工作一次:(
我最近遇到了Xcode 8的這個問題。
解決問題您必須將“共享鑰匙串權利”添加到Xcode功能。
有許多用戶遇到過這個問題。
好吧,經過很長一段時間的努力,我發現我的Apple帳號已經過期,然后才更新到Xcode8。 我通過刪除我的帳戶解決了它,然后再次登錄。 並且僅適用於不是模擬器的設備。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.