O'Reilly logo

Learning Cocoa by Apple Computer Inc

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

Chapter 7. Currency Converter Tutorial

In this chapter you’ll build a single window application from beginning to end, giving you an opportunity to deepen your understanding of the Cocoa programming paradigms discussed in Chapter 6. For the first time, you’ll see the complete work flow typical of Cocoa application development:

  1. Design the application

  2. Create the project (Project Builder)

  3. Create the interface (Interface Builder)

  4. Define the classes (Interface Builder)

  5. Implement the classes (Project Builder)

  6. Build the project (Project Builder)

  7. Run and test the application

The application you’ll build in this chapter is called Currency Converter—a simple utility that converts a dollar amount to an amount in another currency. Currency Converter is an extremely simple application, but there’s still a design behind it. This design is based upon the Model-View-Controller (MVC) paradigm, the model behind many designs for object-oriented programs. MVC separates an application into different types of objects, each with specific roles and responsibilities. This design paradigm aids in the development of a maintainable, extensible, and reusable code base, as the Currency Converter example will make clear.

Design the Currency Converter Application

An object-oriented application should be based on a design that identifies the objects of the application and clearly defines their roles and responsibilities. You normally work on a design before you write a line of code. You don’t need any fancy tools ...

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