Following an answer I found here: https://stackoverflow.com/a/18121292/1701170, I have the following code:
bool accessibilityEnabled = false;
// Check and make sure assistive devices is enabled.
if (AXIsProcessTrustedWithOptions != NULL) {
// 10.9 and later
NSDictionary *options = @{(id)kAXTrustedCheckOptionPrompt: @YES};
accessibilityEnabled = AXIsProcessTrustedWithOptions((CFDictionaryRef)options);
} else {
// 10.8 and older
if (AXAPIEnabled() == true) {
accessibilityEnabled = true;
}
}
if (accessibilityEnabled) {
// do something
}
The error I get is as follows:
[apply] error: use of undeclared identifier 'NSDictionary'; did you mean 'UseDictionary'?
[apply] NSDictionary *options = @{(id)kAXTrustedCheckOptionPrompt: @YES};
[apply] ^~~~~~~~~~~~
[apply] UseDictionary
Do I have to import NSDictionary?
The imports at the top of the file are as follows:
#include <pthread.h>
#include <sys/time.h>
#include <ApplicationServices/ApplicationServices.h>
#include "NativeErrors.h"
#include "NativeGlobals.h"
#include "NativeHelpers.h"
#include "NativeThread.h"
#include "NativeToJava.h"
#include "OSXInputHelpers.h"
This is my first time looking at Objective-C.