ARC error to the const void **

Difficult ARC error:


NSDictionary *var_01;
SecItemCopyMatching((__bridge CFDictionaryRef)var_02, (CFTypeRef *)&var_01);

Error: Cast of an indirect pointer to an Objective-C pointer to ‘CFTypeRef ‘ (aka ‘const void **’) is disallowed with ARC

Solution – don’t use (NSDictionary*)

CFDataRef var_01;
SecItemCopyMatching((__bridge CFDictionaryRef) var_02, ( CFTypeRef*) &var_01);
NSData* passDat=(__bridge_transfer NSData*)var_01;

發表留言