Problem with pointer conversion using Automatic Reference Counting (ARC)

Viewed 4835

My project is using Automatic Reference Counting, and I'm trying to use the following Accessibility API function:

extern AXError AXUIElementCopyAttributeValue (
    AXUIElementRef element,
    CFStringRef attribute,
    CFTypeRef *value);

To call the function, I'm doing something like this:

NSArray *subElements = nil;
AXUIElementCopyAttributeValue(..., (CFArrayRef *)&subElements);

However, ARC is throwing the following error regarding the last argument:

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

How do I resolve this?

1 Answers
Related