« Write formatted text … | Home | MBS Xojo Plugins, ver… »

Fix for missing accessibilityIsAttributeSettable function

For one of our Xojo app, we got crash reports for missing accessibilityIsAttributeSettable function in various classes:

-[NSMenuItem accessibilityIsAttributeSettable:]: unrecognized selector sent to instance 0x600001ffea00
Please report to the application developer.

0 CoreFoundation 0x00007fff3cc54fa5 __exceptionPreprocess + 256
1 libobjc.A.dylib 0x00007fff68d4befb objc_exception_throw + 48
2 CoreFoundation 0x00007fff3ccd2c8d -[NSObject(NSObject) __retain_OA] + 0
3 CoreFoundation 0x00007fff3cbf65de ___forwarding___ + 1468
4 CoreFoundation 0x00007fff3cbf5f98 _CF_forwarding_prep_0 + 120
5 AppKit 0x00007fff3a7aea33 NSAccessibilityPerformEntryPointBOOL.llvm.11937614488442194757 + 16
6 AppKit 0x00007fff3a545d63 NSAccessibilityEntryPointIsAttributeSettable + 86
7 AppKit 0x00007fff3a61a460 -[NSCarbonMenuImpl _carbonIsAccessibleAttributeSettableEvent:handlerCallRef:axElement:] + 185
8 AppKit 0x00007fff3a409778 NSSLMMenuEventHandler + 1009
9 HIToolbox 0x00007fff3be26b79 _ZL23DispatchEventToHandlersP14EventTargetRecP14OpaqueEventRefP14HandlerCallRec + 1502

The name of the class and functions related in the stack trace changes, but the problem is always the same. Same function in Apples framework wants to call deprecated accessibilityIsAttributeSettable function, but that one is no longer implemented in Apple's own classes. It's a code path which doesn't happen for all users, so only a few get the crash and maybe this is related to some accessibility setting.

Anyway, via a new InstallNSAccessibilityPatchMBS function in our plugin, we'll patch it and install a accessibilityIsAttributeSettable function to just return false every time. If the class has such a method, the class method is preferred, but we install a fallback to avoid the crash.

So when you see such a crash, you can soon try our MBS Xojo Plugins in version 18.5 and call InstallNSAccessibilityPatchMBS method on start of the application. The biggest plugin in space...
07 11 18 - 16:06