Pointer casting with ARC

前端 未结 3 1574
一生所求
一生所求 2021-02-03 22:32

ARC is giving me a hard time with following cast:

NSDictionary *attributes;
SecItemCopyMatching((__bridge CFDictionaryRef)keychainItemQuery, (CFTypeRef *)&at         


        
3条回答
  •  梦毁少年i
    2021-02-03 22:38

    Need to change attributes to &attributes

    CFDataRef attributes;
    SecItemCopyMatching((__bridge CFDictionaryRef) keychainItemQuery,  ( CFTypeRef*) &attributes);
    NSData* passDat=(__bridge_transfer NSData*) attributes;
    

提交回复
热议问题