我的项目正在使用Automatic Reference Counting,我正在尝试使用以下 Accessibility API 函数:
extern AXError AXUIElementCopyAttributeValue (
AXUIElementRef element,
CFStringRef attribute,
CFTypeRef *value);
要调用该函数,我正在做这样的事情:
NSArray *subElements = nil;
AXUIElementCopyAttributeValue(..., (CFArrayRef *)&subElements);
但是,ARC 对最后一个参数抛出以下错误:
error: Automatic Reference Counting Issue: Cast of an indirect pointer to an Objective-C pointer to 'CFArrayRef *' (aka 'const struct __CFArray **') is disallowed with ARC
我该如何解决这个问题?