我想将访问令牌存储到钥匙串中。但我得到的错误:Couldn't add the Keychain Item.'
KeychainItemWrapper'无法添加钥匙串项目'。
我查了一些职位上的计算器一样: Storing email in keychain impossible (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马华的回答接通分享钥匙扣权利只是工作曾经对我来说:(
重复http://stackoverflow.com/questions/38456471/secitemadd-always-returns-error-34018-in-xcode-8-in-ios-10-simulator? –