SecKeyRef getPublicKeywithRawKey(NSString *peerNode,NSData *publicKey){
    
    OSStatus sanityCheck = noErr;
    SecKeyRef peerKeyRef = NULL;
    CFTypeRef persistPeer = NULL;
    CFDictionaryRef tmpDic;
    //LOGGING_FACILITY( peerName != nil, @"Peer name parameter is nil." );
    //LOGGING_FACILITY( publicKey != nil, @"Public key parameter is nil." );
    
    NSMutableDictionary * peerPublicKeyAttr = [[NSMutableDictionary alloc] init];
    
    [peerPublicKeyAttr setObject:(id)kSecClassKey forKey:(id)kSecClass];
    [peerPublicKeyAttr setObject:(id)kSecAttrKeyTypeRSA forKey:(id)kSecAttrKeyType];
    [peerPublicKeyAttr setObject:[peerNode dataUsingEncoding:NSUTF8StringEncoding] forKey:(id)kSecAttrApplicationTag];
    [peerPublicKeyAttr setObject:publicKey  forKey:(id)kSecValueData];
    [peerPublicKeyAttr setObject:[NSNumber numberWithBool:YES] forKey:(id)kSecReturnPersistentRef];
    tmpDic = (CFDictionaryRef)peerPublicKeyAttr;     sanityCheck = SecItemAdd((CFDictionaryRef) peerPublicKeyAttr, (CFTypeRef *)&persistPeer);
}问题是,
2012-04-13 15:58:12.649 macOS_RsaTest1[1502:403] -[NSConcreteMutableData _fastCharacterContents]: unrecognized selector sent to instance 0x7fe301a0a560
2012-04-13 15:58:12.651 macOS_RsaTest1[1502:403] -[NSConcreteMutableData _fastCharacterContents]: unrecognized selector sent to instance 0x7fe301a0a560是在macos 中,我不能用 (CFDictionaryRef) peerPublicKeyAttr 这种方式吗? 请高手忙帮看下。