Summary

In this chapter we learned about delegation, a system that lets a programmer specify objects that should automatically be sent messages when certain events happen. We used delegation to catch the NSApplication object’s applicationDidFinishLaunching: message, which is the standard technique for specifying code that should be run when an application is initialized.

Having done this, we modified our Calculator so that it could change its size using the setFrame:display:animate: method. We also learned a little bit more about NSWindow and NSView objects.

In the next chapter, we’ll revisit our ongoing discussion of events — the basic data type used by Cocoa to keep track of actions initiated by the user. We’ll then see how events are handled by the NSResponder class, the abstract superclass of NSApplication, NSView, and NSWindow, which contains much of the Mac OS X event-handling mechanism.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.191.233