how to cast an indirect pointer in Objective-C

casting, ios, objective-c, pointers

Solution

Use void * instead:

 OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)searchDictionary,(void *)&result);

Problem

I am trying to do some work on my keychain and am following this tutorial here Unfortunately I am getting the following error where it talks about searching the keychain ``` Cast of an indirect pointer to an Objective-C pointer to 'CFTypeRef *' (aka 'const void **') is disallowed with ARC ``` This is what the code looks like ``` OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)searchDictionary,(CFTypeRef *)&result); ``` Any help providing the correct code on how to cast indirect pointer would be greatly appreciated.

Original source