Introduction

In this tutorial, you will get to know the overview of the basic structure of a simple iPhone app.

if you don’t aware about what tools you required to develop an iPhone app then go through this link “What you required to Begin iOS Programing.

Here we start…

To understand the structure of an iPhone app, Lets create a sample project.

Open Xcode and create a new project.

Select Single view Application and Press Next button. See below screen :

Choose a template
Choose a template

Fill the following information as shown in below image :

Choose option for new project
Choose option for new project

Here you will get basic information about fields which we filled up in above image.

  • Product Name : “Your Project Name” [Here “HelloWorld”]
  • Organization Name : “Your Organization Name
  • Company Identifier : “Domain Name

Any domain name but remember , what ever domain name you set it will set in “Bundle Identifier” so choose it wisely

  • Bundle Identifier :

It is a unique identifying string which is used to locate an application’s bundle at run-time.

A bundle identifier , must be registered with Apple and It should be Unique to application.

Bundle identifiera normally [Not Always] written out in Reverse DNS notation. (For example : co,.mycompany.helloword)

  • Device : iPhone

Note : For this project Unchecked [Story-board and Include Unit Testes] field. we will create projects on storyboard in future, but for now, Keep Unchecked these options.

Click next Button..

Select the place where you need to store the Project and Click “Create”.

Its Done !!!! Simple right ? Now lets see what our project contains :

But before that refer this image which will give you information about Xcode structure :

Xcode4Workspace
Xcode4Workspace

In you project , Left most part you will see Project Navigator

In which , you see following groups with some files. Expand each and every group (as shown in below image : )

Project_Navigator

Here we will Go through each file and understand for what it exists for and what its use :

  • Xib/Nib : It contains UI-elements and other UI-control’s. It will show you pictorial view of an object. See Below Image :


Xib_file

  • info.plist : It conatins all configuration details regarding application.
info.plist
info.plist
  • main.m : the execution of an Objective-C app begins from main()
Main file
Main file
  • _prefix.pch :

This file is included at the top of every translation unit [Means Every compiled objective c File]

Normally it is used to import framework headers, by which we don’t have to type #import <Foundation/Foundation.h> in every file.

prefix.pch
prefix.pch

 

  • AppDelegate :

This file is responsible for launch-time initialization.

Primary job of this object is to handle state transitions within the app.

Responsible for launch-time initialization and handling transitions to and from the background.

  • Controller objects :

This type of files are intermediary between Model & View.

It Updates the view when the model changes.

It also Updates the model when the user manipulates the view.

So in short we can tell that, this file contain app logic.

  • View of app :

Present the Model to the User in an appropriate interface

Allows user to manipulate data

Easily reusable & configure to display data

You’ve now reached the end of the introduction of an iPhone app structure. i think this much information is sufficient to make your first iPhone app.

In Next Tutorial we are going to create our first iPhone app. Before moving to next tutorial if you have any questions or comments about what we have finished so far, then delight let us know.