gpt4 book ai didi

iphone - 关于 ios KeychainItemWrapper 存储用户名/密码而不是对象

转载 作者:行者123 更新时间:2023-11-29 11:01:24 26 4
gpt4 key购买 nike

我知道保存用户名/密码使用下面的 KeychainItemWrapper 类方法,但我想在 KeychainItemWrapper 中添加一个额外的 [ipTF 文本]。怎么做?

KeychainItemWrapper *keychainItem = [[KeychainItemWrapper alloc] initWithIdentifier:@"Login" accessGroup:nil];

[keychainItem setObject:[useridTF text] forKey:(__bridge id)(kSecAttrAccount)];
[keychainItem setObject:[passTF text] forKey:(__bridge id)(kSecValueData)];
[keychainItem setObject:[ipTF text] forKey:@"ip"];//not success!

最佳答案

我认为不可能在 key 链项中创建任意键/值对。

钥匙串(keychain)服务引用

This section lists all the keys that specify keychain item attributes. The description of each item indicates what the possible values are for that key.

可能的 key 列表由 kSecClass 确定。您可以在 Keychain Services References 中找到选项列表及其说明。在下面描述如何确定 key 集的引述下。

Key constant used to set the item class value in a search dictionary.

CFTypeRef kSecClass;
Constants

kSecClass
Dictionary key whose value is the item's class code. Possible values for this key are listed in “ Item Class Value Constants.”

关于iphone - 关于 ios KeychainItemWrapper 存储用户名/密码而不是对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15765560/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com