O'Reilly logo

Cocoa Programming for OS X: The Big Nerd Ranch Guide by Aaron Hillegass, Adam Preble, Nate Chandler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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​,​ ​ ​ ​ ​ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required