Re: Using an enclosing view ass accessibility title
Re: Using an enclosing view ass accessibility title
- Subject: Re: Using an enclosing view ass accessibility title
- From: James Dempsey <email@hidden>
- Date: Mon, 17 Aug 2009 10:59:21 -0700
On Aug 16, 2009, at 7:05 AM, Christiaan Hofman wrote:
I have a text field that's placed in an NSBox, and I'd like to use
the title of the box as the accessibility title for it. So I
connected the corresponding outlet accordingly in IB. However, I
recently figured out that this leads to a retain cycle and therefore
a leak. Is there an alternative way to achieve this?
You could either:
1. Give the text field an accessibility description that is the same
string as the NSBox's title, rather than associating the text field
with its container directly. If the NSBox title changes over time,
just update the overridden attribute on the text field to the new title.
2. Break the retain cycle by removing the overridden attribute when
the window is going away. In most cases doing so in the window's -
dealloc method would work, or in a window delegate method when the
window is about to go away.
-James
--------------------------------------------------
James Dempsey
AppKit Engineering
Apple
email@hidden
_______________________________________________
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