iOSのキーチェーンに本当に問題があります。
ここにありself.keychainItemQuery
ます:
{
kSecClass = kSecClassGenericPassword;
kSecAttrGeneric = "com.mycompany.player";
kSecMatchLimit = kSecMatchLimitOne;
kSecReturnAttributes = kCFBooleanTrue;
}
私がする時
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)self.keychainItemQuery, &attributes);
私は得る
status == errSecItemNotFound
さて、ここにありself.keychainItemData
ます:
{
kSecAttrAccount = "";
kSecClass = kSecClassGenericPassword;
kSecAttrDescription = "";
kSecAttrGeneric = "com.mycompany.player";
kSecAttrLabel = "";
kSecValueData = <35663636 65623135 64303139 65363535>;
}
しかし、私がするとき
OSStatus result = SecItemAdd((__bridge CFDictionaryRef)dictionary, NULL);
私は得る
result == errSecDuplicateItem
キーホルダーのアイテムはキーオフされていると思いましたkSecAttrGeneric
。上記のクエリは、コード内の他のポイントでキーチェーンアイテムを見つけます。なぜこれが機能しないのかについての詳細が欠けているような気がします。