【问题标题】:how to cast an indirect pointer in Objective-C如何在 Objective-C 中转换间接指针
【发布时间】:2013-07-23 23:48:20
【问题描述】:

我正在尝试在我的钥匙串上做一些工作,并且正在关注本教程here 不幸的是,我在谈论搜索钥匙串时遇到以下错误

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);

任何提供有关如何强制转换间接指针的正确代码的帮助将不胜感激。

【问题讨论】:

  • 在通过之前投射。

标签: ios objective-c pointers casting


【解决方案1】:

使用 void * 代替:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-02-10
    • 2012-02-08
    • 1970-01-01
    • 1970-01-01
    • 2013-12-25
    • 1970-01-01
    • 2010-10-02
    相关资源
    最近更新 更多