• 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
NSNotificationQueue Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSNotificationQueue Question


  • Subject: NSNotificationQueue Question
  • From: Richard Charles <email@hidden>
  • Date: Wed, 20 May 2015 11:18:58 -0600

I have a bit of code that posts notifications to coalescing notification queue.

// Post did change notifications to a coalescing notification queue.
// Notifications are coalesced that match both the notification name and
// object. The notification is posted at the end of the current notification
// callout or timer.
NSNotification *notification =
[NSNotification notificationWithName:MyRelationshipDidChangeNotification
                              object:object
                            userInfo:change];
[[NSNotificationQueue defaultQueue] enqueueNotification:notification
                                           postingStyle:NSPostASAP];

In another place I need to force the notification queue to issue a did change notification.

// Force notification queue to issue notification.
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:nil];

This works but the problem is that there are undesirable side effects to running the runloop once when this call is made.

What I would like to do is to run the runloop once but only cause the notification queue to post this notification but not do other things.

Anyone know how to do this?

--Richard Charles


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: NSNotificationQueue Question
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: NSFontPanel swamping the responder chain (and crashing)
  • Next by Date: Re: Tracking the retain count
  • Previous by thread: Move a folder and update corresponding Finder sidebar favorite
  • Next by thread: Re: NSNotificationQueue Question
  • Index(es):
    • Date
    • Thread