2016-08-30 12 views
1

Keychainの属性の辞書を取得したいが、の要素の1つがNSDictionaryである。ここでは、属性を取得する私のコードは次のとおりです。retNSArrayタイプであるのはなぜKeychainの属性を取得するNSArray

NSMutableDictionary *queryDictionary = [KeychainQueryDictionaryWithServiceAndIdentifier(serviceName, identifier) mutableCopy]; 
queryDictionary[(__bridge id)kSecReturnAttributes] = (__bridge id)kCFBooleanTrue; 
queryDictionary[(__bridge id)kSecMatchLimit] = (__bridge id)kSecMatchLimitAll; 

CFDictionaryRef result = nil; 
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)queryDictionary, (CFTypeRef *)&result); 

if (status != errSecSuccess) { 
    NSLog(@"Unable to fetch account info with identifier \"%@\" (Error %li)", identifier, (long int)status); 
    return nil; 
} 

id ret = (NSDictionary *)CFBridgingRelease(result); 

そしてここでは、コンソール

enter image description here

からいくつかのINFOMATIONですか?

答えて

0

queryDictionary[(__bridge id)kSecMatchLimit] = (__bridge id)kSecMatchLimitOne;

修正済み!

関連する問題