We previously implemented this method as a stub that called NSBeep()
. Now, we need to remove that call to the
NSBeep()
function and implement the final working program code as follows:
Start by putting a comment in the
NewDefaults.m
file that describes the method in plain English as follows:/* Create the Preference Pane implementation for when a checkbox is clicked this method is called with the sender equal to the check box that invoked it */
The method needs to match the interface from the
.h
file. So now we can add the function body to the.m
file as follows:- (IBAction)myButtonAction:(id)sender; { }
Mac OS X 10.7 introduced a new feature called Sudden Termination. This feature is used to inform the Mac OS when it is safe to kill, rather than gracefully quit from our App (System Preferences is an App). Because we are about to enter a critical part of code, we are going to tell the Mac OS that it is not safe to kill...