NSApplication and NSApplicationDelegate

Every Cocoa application has a single instance of NSApplication and a single instance of a custom class named AppDelegate, which conforms to the NSApplicationDelegate protocol. When events happen in the lifecycle of the application, methods on the NSApplicationDelegate protocol are called. You implement these methods as needed in the app delegate.

Here are a few methods from the NSApplicationDelegate protocol:

 ​ ​o​p​t​i​o​n​a​l​ ​f​u​n​c​ ​a​p​p​l​i​c​a​t​i​o​n​D​i​d​F​i​n​i​s​h​L​a​u​n​c​h​i​n​g​(​_​ ​a​N​o​t​i​f​i​c​a​t​i​o​n​:​ ​N​S​N​o​t​i​f​i​c​a​t​i​o​n​)​ ​ ​o​p​t​i​o​n​a​l​ ​f​u​n​c​ ​a​p​p​l​i​c​a​t​i​o​n​(​_​ ​a​p​p​l​i​c​a​t​i​o​n​:​ ​N​S​A​p​p​l​i​c​a​t​i​o​n​,​ ​ ​ ​ ​ ...

Get Cocoa Programming for OS X: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.