Exercises

  1. Modify our Calculator application by relabeling the on-screen hex buttons A-F with the lowercase letters a-f. Also, make the “c” key on the keyboard work as the hex c button, and the capital letter “C” work as the Clear button. Finally, fix the keyboard input for the “0” button.

  2. Try using key equivalents for all of the buttons in the Calculator instead of the more complicated way we caught key events in this chapter. How can this be done for hex characters?

  3. Add more sophisticated mathematical functions, such as sin, cos, and log, to our Calculator application. Use IB as a prototyping tool to redesign the Calculator window to accommodate these new functions.

  4. From scratch, develop your own new calculator program that looks and works exactly like the bundled Calculator program in the /Applications folder.

Get Building Cocoa Applications: A Step by Step Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.