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
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 8. A Window with a View > Responding to Window Events by Delegating Aut...

8.4. Responding to Window Events by Delegating Authority

Cocoa has an interesting construct — delegates — which lets a class take over the task of handling certain events for you. Much like you might delegate authority to another person in the workplace, you can delegate the authority of a class to handle things when a particular event(s) occurs.

For example, you can tell a class to be a delegate for window events like miniaturizing (also known as minimizing). Therefore, every time a window miniaturizes, your delegate class would do something in response.


  

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
  • DownloadDownload
  • PrintPrint