Reader Level:
ARTICLE

How to Print Hello Word in iPhone or iPad

Posted by Sachin Bhardwaj Articles | iOS October 19, 2012
In this article I will explain the step-by-step process of printing hello world in an iPhone or iPad.
  • 0
  • 0
  • 2904
Download Files:
 

Introduction

The sample in this article is a very simple program for beginners that provides a good start in iPhone/iPad application development. In this article we can print Hello Word in both the iPhone Simulator or the iPad Simulator.

Step 1

First search XCode (IDE) in Finder and open it.

xcode-in-iphone.jpg

Step 2

In XCode, you will see Create a New XCode Project; click on it.

create-project-in-iphone.jpg

Step 3

Now select Single View Application and click on Next.

single-view-application-in-iphone.jpg

Step 4

Now give your Product Name. Here I use Hello Word and Company Identifier Mcn Solutions and click on Next.

project-name-in-iphone.jpg

Step 5

Select location where you want to save your project and click on Create.

save-project-location-in-iphone.jpg

Step 6

Now you will see in the XCode Window six Objective C Classes which are automatically generated by XCode.

1.Appdelegate.h
2.AppDelegate.m
3.ViewController.h
4.ViewController.m
5.ViewController_iPhone.Xib
6.ViewContoller_iPad.Xib.

Here the first two delegate classes, Middle two UiView Controller Class of Objective C and the last two are a Nib file in respect of iPhone or iPad.

Step 7

Now we code in the View Controller Class and select ViewController.Xib file in Correspondence iPhone or iPad.

nib-file-for-iphone.jpg

nib-file-for-ipad.jpg

To set the alignment click on it.

Step 8

In Xcode, you will see a Property Window. From it we select Label and use drag and drop to put it on View Correspondence iPhone or iPad.

property-window-in-iphone.jpg

Here we take label from it.

Step 9

Now select which platform you want to see the output in.

how-to-run-application-in-simulator-in-iphone.jpg

Output

output-in-iphone.jpg

output-in-ipad.jpg

Thanks!!

COMMENT USING