Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 16. Notifications > Enqueuing Notifications

Enqueuing Notifications

From: notify.m

44 NSNotificationQueue *nq =
45   [NSNotificationQueue defaultQueue];
46 NSNotification *note = [NSNotification
47   notificationWithName: @"Example"
48                 object: @"sender"];
49 [nq enqueueNotification: note
50            postingStyle: NSPostWhenIdle];
51 [[NSRunLoop currentRunLoop] run];

Sometimes, your code might be generating a lot of notifications, or may be generating ones that do not need to be handled immediately. The NSNotificationQueue class solves both of these problems.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint