最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[已解决]swift代码出错:Cast of an indirect pointer to an Objective-C pointer to ‘CFTypeRef *’ (aka ‘const void **’) is disall

iOS crifan 3085浏览 0评论

代码:

        NSMutableDictionary *outDictionary = nil;

       

        if (! SecItemCopyMatching((CFDictionaryRef)tempQuery, (CFTypeRef *)&outDictionary) == noErr)

出错:

KeychainItemWrapper/KeychainItemWrapper.m:132:63: Cast of an indirect pointer to an Objective-C pointer to ‘CFTypeRef *’ (aka ‘const void **’) is disallowed with ARC

如图:

Cast of an indirect pointer to an Objective-C pointer to ‘CFTypeRef *’ (aka ‘const void **’) is disall

ios – how to cast an indirect pointer in Objective-C – Stack Overflow

改为:

if (! SecItemCopyMatching((CFDictionaryRef)tempQuery, (void *)&outDictionary) == noErr)

即可。

转载请注明:在路上 » [已解决]swift代码出错:Cast of an indirect pointer to an Objective-C pointer to ‘CFTypeRef *’ (aka ‘const void **’) is disall

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
84 queries in 0.211 seconds, using 22.10MB memory