advertisement

Article:
  Building a Scratch Pad with Cocoa
Subject:   Error in Scratch Pad
Date:   2002-04-09 05:38:50
From:   cheeseb
In the override of the keyDown: method in Scratch Pad, you neglect to call super if some key other than "c" was pressed. When you implement keyDown: in a subview, you have to send a [super keyDown:theEvent] message in all cases that you don't handle yourself, so that some responder higher up the responder chain can have a crack at the event. Ultimately, if nobody responds, this will enable the application to beep, as it normally does when you press a key to which no view responds.


This is a great series. Keep 'em coming!