Re: Retaining an AXUIElementRef
Re: Retaining an AXUIElementRef
- Subject: Re: Retaining an AXUIElementRef
- From: Mike Engber <email@hidden>
- Date: Tue, 25 Jun 2013 09:20:09 -0700
On Jun 24, 2013, at 10:34 PM, Patrick Cusack <email@hidden> wrote:
> Considering this, what is best practice for making sure you have the object you think you have cached? I can always check its title attribute. Is there a faster way?
Watching for NSAccessibilityUIElementDestroyedNotification's and using them to clear out an refs you are caching is the best practice - it sounds like you are already doing this.
There isn't any reliable way to work around this problem. There might be tricks that work in specific cases - e.g. when you detect certain changes in the UI (e.g. selection changes) you might want to flush your cache.
If you register for a NSAccessibilityUIElementDestroyedNotification on a ui element that won't actually send it, you should get an kAXErrorNotificationUnsupported. Also, if you use (and I know you do…):
-NSAccessibilityDebugLogLevel 1
there should be logging to the console.
You should file bugs about elements for which you can't successfully register for NSAccessibilityUIElementDestroyedNotification.
If you can successfully register for NSAccessibilityUIElementDestroyedNotification on an element that doesn't send it, be sure to make note of this in the bug - it means it's a more serious bug.
-ME
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden