如何在Objective-C中强制转换间接指针 [英] how to cast an indirect pointer in Objective-C

查看:499
本文介绍了如何在Objective-C中强制转换间接指针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在钥匙串上做一些工作,并且正在按照本教程此处 不幸的是,我在搜索钥匙串时遇到了以下错误

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

这是代码的样子

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

对于提供有关如何转换间接指针的正确代码的任何帮助,将不胜感激.

Any help providing the correct code on how to cast indirect pointer would be greatly appreciated.

推荐答案

使用void *代替:

Use void * instead:

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

这篇关于如何在Objective-C中强制转换间接指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆