Re: Does AXObserverRemoveNotification work?
Re: Does AXObserverRemoveNotification work?
- Subject: Re: Does AXObserverRemoveNotification work?
- From: Bill Cheeseman <email@hidden>
- Date: Tue, 19 Nov 2002 05:53:18 -0500
on 02-11-18 8:48 PM, Matthew Formica at email@hidden wrote:
>
This has been mentioned on this list before. This is a known bug; currently
>
if you try to call AXObserverRemoveNotification you'll crash the app you
>
were observing. So the workaround is to not remove yourself as an observer.
>
But don't gut that code altogether; it will be fixed in in an upcoming OS
>
release, at which point you can conditionalize things and remove yourself as
>
an observer if you are on a fixed system.
I searched the list for the function name and came up with "Sorry, but the
search returned no results."
What does "if you are on a fixed system" mean?
I was planning to do the code-branching thing. I have an easy workaround,
too, since I'm writing a Cocoa framework to wrap the C API. I maintain a
cache of registrations anyway, and the C callback function is in my
framework -- it uses NSInvocation to call the client's Objective-C callback
method. So when a client tries to unregister a notification, I'll just
remove it from my cache. Thereafter, I can intercept any notifications that
are received for that registration in my C callback function and simply
decline to invoke the NSInvocation object if they aren't registered. The
observer will remain valid in case it has any other active registrations.
Once the bug is fixed, I'll branch around the workaround and call
AXObserverRemoveNotification instead.
So far, my experience developing the Cocoa wrapper has led me to think the C
API needs a few additional functions. For example, it would be very useful
to have official access to an observer's list of registered notifications
and their associated elements, so I don't have to cache them myself. Once I
have my list of feature requests ready, I'll post it to RadarWeb. In the
meantime, do you guys have any candidates for additional functions?
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont -
http://members.valley.net/croquetvermont
_______________________________________________
accessibility-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/accessibility-dev
Do not post admin requests to the list. They will be ignored.