O'Reilly logo

Mac Application Development by Example Beginner's Guide by Robert Wiebe

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

Time for action – writing the myButtonAction: program code

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:

  1. 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
     */
  2. 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;
    {
    
    }
  3. Mac OS X 10.7 introduced a new feature called Sudden Termination. This feature is used ...

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