Re: Accessibility Problems...
Re: Accessibility Problems...
- Subject: Re: Accessibility Problems...
- From: Joseph Kelly <email@hidden>
- Date: Fri, 8 Sep 2006 09:08:03 -0700
Use the debugging environment variable NSAccessibilityDebugLogLevel
with a value of one.
Specify it in xcode (edit active executable)
or by launching your app from the command line
foo.app/Contents/MacOS/foo -NSAccessibilityDebugLogLevel 1
It will spew informative messages to the console.
I have set this variable (as both an environment variable and command
line from Executable Info) but so far no info on the console. I even
quit and relaunched Xcode :-) Are there any other variables I need to
set, or other incantations?
So my first guess is there's an asymmetry in the parent-child
hierarchy.
Oh duh, I was returning the child directly, and not in an NSArray
(answering the nagging question "why does it think that the child is
an array?") When I fix this, I no longer get the exception. Still not
quite working, but I'm headed in the right direction.
If you're already doing that then the problem could have to do with
equality testing. Element x will be looked for in element y's
children list using isEqual. If you're creating objects for element
x on the fly (i.e. a different object each time) then you should
know that by default, NSObject use pointer equality for isEqual.
You'll need to override this - and if you override isEqual, hash
should be overridden appropriately as well (equal object must hash
the same).
This will definitely become an issue -- for right now, however, I'm
only instantiating one object
Another common problem is returning an ignored ui element.
NSAccessibilityDebugLogLevel will catch this too. The utility fns
NSAccessibilityUnignoredAncestor and
NSAccessibilityUnignoredDecendant help solve this.
Will this ever become an issue if the parents and descendants up the
chain all return NO for accessibilityIsIgnored:?
There's a couple of different sample code entries that show how to
accessorize an NSObject subclass from scratch. I strongly recommend
you steal from them liberally. Here's a link to one:
http://developer.apple.com/samplecode/ImageMapExample
I am looking through this right now.
Also, I'm hoping to make my accessible objects nested/hierarchical --
they will contain "subviews" (i.e. return sub-children) etc. Will I
have to do anything special for hit testing or will the accessibility
framework be able to figure out from the position/size of all the
children and sub-children?
Thanks
Joseph K.
_______________________________________________
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