我正在尝试对我的钥匙串做一些工作,并且正在关注本教程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);
非常感谢任何提供有关如何投射间接指针的正确代码的帮助。
答案 0 :(得分:27)
使用void *代替:
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)searchDictionary,(void *)&result);