最新消息:20190529 VPS服务器已从腾讯云香港换为Vultr新加坡,主题仍用朋友推荐的大前端D8

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

iOS crifan 868浏览 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,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
59 queries in 0.114 seconds, using 18.62MB memory