• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSAccessibilityAnnouncementRequestedNotification does not seem to work
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSAccessibilityAnnouncementRequestedNotification does not seem to work


  • Subject: Re: NSAccessibilityAnnouncementRequestedNotification does not seem to work
  • From: Henri Normak <email@hidden>
  • Date: Thu, 25 Jul 2013 08:39:10 +0300

Hi Josh,

Thanks for the tip, sending to [NSApp mainWindow] seems to work. As it's not about an element being destroyed the second suggestion wasn't really applicable in this case. My goal was to notify of an event, an abstract one happening in the model layer, so there might not always be a direct view element corresponding to this event (an analogy would be a long process completing, but the UI showing progress being hidden).

I think the documentation in this case was slightly misleading. Mainly for this comment in NSAccessibility.h -
"...This notification should be posted for the application element." it's next to NSAccessibilityAnnouncementRequestedNotification - this made me believe that I need to send the notification to NSApp. I've filed a radar for clarifying that documentation part. (rdar://14543376)

Thank you for your help,
Henri


On Wed, Jul 24, 2013 at 11:59 PM, Josh Scotland <email@hidden> wrote:
Hi Henri,

Try posting the notification on another object. There are comments in NSAccessibility.h detailing that NSApp has some special behavior for certain notifications.

If you’d like to post notifications on your custom non-Cocoa objects, make sure to use the new API:
- (BOOL)accessibilityNotifiesWhenDestroyed NS_AVAILABLE_MAC(10_9);

Details of how to implement it are in NSAccessibility.h!

Josh

On Jul 24, 2013, at 12:29 AM, Henri Normak <email@hidden> wrote:

Hello everyone,

I've been trying to take advantage of the new NSAccessibilityAnnouncementRequestedNotification introduced with 10.9, the goal is to post an announcement about an event that is out of scope for VO users (i.e happens without VO getting feedback in another part of the application).

However, it seems like the announcement is never actually delivered. If I am understanding the documentation correctly, then the following code should deliver an announcement saying "Test" to the VO user.

NSDictionary *announcementInfo = @{NSAccessibilityAnnouncementKey : @"Test",
                                                              NSAccessibilityPriorityKey : @(NSAccessibilityPriorityHigh)};
NSAccessibilityPostNotificationWithUserInfo(NSApp, NSAccessibilityAnnouncementRequestedNotification, announcementInfo);

I've tried various priority levels, including not giving a priority at all. What am I missing? Have I misunderstood the element of the notification being NSApp? I've tried running this code on all of the developer previews, without any success.

Thanks,
Henri

-- 
Henri Normak
@henrinormak
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list      (email@hidden)

This email sent to email@hidden




--
Henri Normak
+37253406707
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

References: 
 >NSAccessibilityAnnouncementRequestedNotification does not seem to work (From: Henri Normak <email@hidden>)
 >Re: NSAccessibilityAnnouncementRequestedNotification does not seem to work (From: Josh Scotland <email@hidden>)

  • Prev by Date: Re: NSAccessibilityAnnouncementRequestedNotification does not seem to work
  • Next by Date: Re: NSAccessibilityAnnouncementRequestedNotification does not seem to work
  • Previous by thread: Re: NSAccessibilityAnnouncementRequestedNotification does not seem to work
  • Next by thread: Re: NSAccessibilityAnnouncementRequestedNotification does not seem to work
  • Index(es):
    • Date
    • Thread