Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Defining the Model

Model objects contain special knowledge and expertise. They hold data and define the logic that manipulates that data. For example, a customer object, common in business applications, is a model object. In Currency Converter, the model class you’re going to create is the converter class. In the MVC design pattern, instances of a model class do not communicate directly with the user interface.

In this chapter, you will create the model for your application. First, you will learn how to create a new class in Xcode. Then, you will define the interface for your model before implementing it. Finally, you will implement the entire functionality of the class. In the process, you will learn some of the syntax of Objective-C, including how to declare variables and methods. You will also be introduced to the concept of declared properties—a feature in Objective-C 2.0 that makes writing accessor methods incredibly quick and simple.

Contents:

Specify the Model Class
Declare the Model Interface
Implementing the Model
What’s Next?




< Previous PageNext Page > Hide TOC


Last updated: 2007-10-31




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice