As a developer you must be thinking why to develop for iPhone? Over 1 billion iPhone applications downloaded in 6 months. Over 50,000 applications currently available and this number increasing exponentially. Number of iPhones and iPod crossed 50 million across 85 countries. It has a great development environment. Plenty of money for the developer to get rich through App Store. There are lots of innovative features on iPhone.

iPhone Frameworks Overview

Cocoa Framework has been used in Mac OS for quite some time. Similarly in iPhone OS, Apple introduced Cocoa Touch Framework. Following is a brief comparison between these two frameworks.

Cocoa vs. Cocoa Touch
Cocoa (Mac OS)

  • AppKit (Framework)
    • NSView, NSControl
  • Foundation (Framework)
    • NSObject, NSString, NSArray

Cocoa Touch (iPhone OS)

  • UIKit (Framework)
    • UIView, UIControl
  • Foundation (Framework)
    • NSObject, NSString, NSArray

You can develop two types of applications for the iPhone:

  • Native Applications
  • Web Applications

In this tutorial, We will focus on developing native applications that run locally on the iPhone.

Anatomy of an Application

  • Compiled Code
    • Your code
    • Frameworks
    • Libraries
  • Nib files (Interface files)
    • UI elements and other objects
    • Details about object relationships
  •  Resources
    • Images, Sounds, Localized Strings etc.
  • Info.plist file
    • Application configuration file
  • Sandboxes
    • Designated application running space for the sake of security.
    • Your application can play in its own sandbox and cannot share toys with other applications.

Platform Limitations

  • Data Access Limits: Sandboxed applications
  • Memory Limits: Application’s memory management
  • Interaction Limits: Mouse or keyboard replaced with multi-touch
  • Energy Limits: Applications utilizing camera and location
  • Application Limits: “One application at a time”
  • User Behavior Limits: User enters a program, use it quickly, and leaves it just as quickly

Fundamental Design Patterns

1. MVC

The Model-View-Controller (MVC) design pattern is a way of dividing your code in to independent
functional areas.

  • The model portion defines your application’s underlying data engine and is responsible for
  • maintaining the integrity of that data.
  • The view portion defines the user interface for your application and has no explicit knowledge of the origin of data displayed in that interface.
  • The controller portion acts as a bridge between the model and view and facilitates updates between them.

2. Delegation

Delegation design pattern avoids need to subclass complex objects. Control passed to delegate objects to perform application-specific behavior. Many UIKit calsses use delegates:

  • UIApplication
  • UITableView
  • UITextField
  • e.t.c

3. Target-Action

Controls use the target-action design pattern to notify your application of user interactions. When event occurs, action is invoked on target object. When the user interacts with a control in a predefined way (such as by tapping a button), the control sends a message (the action) to an object you specify (the target). Upon receiving the action message, the target object can then respond in an appropriate manner (such as by updating application state in response to the button push).

Tagged with: C/C++ languageObject Oriented

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Related News Feeds

Set your Twitter account name in your settings to use the TwitterBar Section.