Execute HelloWorld Program In iPad

This is the “HelloWorld” example, i am going to run this application in the iPad. For the iPad application , required “iPhone SDK 3.2” , so first install the iPhoneSDK 3.2 . There have so many way to display the HelloWorld in the iPad, but i’ll show you “HelloWorld” example using Interface Builder and writing little code.This is the very simple application. So let see how it will be worked.

Step 1: Open the Xcode and create a new Xcode project usingView base application template. Give the application name “Button Fun iPad”.

Step 2: Xcode automatically creates the directory structure and adds essential frameworks to it. You can explore the directory structure to check out the content of the directory.

Step 3: xpand classes and notice Interface Builder created the Button_Fun_iPadViewController class for you. Expand Resources and notice the template generated a separate nib, Button_Fun_iPadViewController.xib, for the “Button Fun iPad”.

Step 4: In the Button_Fun_iPadViewController.h file, we have added UILabel for display the text and added IBAction buttonPressed: so make the following changes in the file.

 

 

 

Step 5: After changing in the Button_Fun_iPadViewController.h, double click the Button_Fun_iPadViewController.xib file open it to the Interface Builder.

a) Open the View window, first drag the label from the library and place it to the view window and select the label and bring up Attribute Inspector and delete the text.

b) Next drag a Round Rect from the library and place it to the view window. double click the Round Rect and give the name “ClickMe”.

c) Now connect the File’s Owner icon to the View icon and select view.

d) Connect File’s Owner icon to label and select ”statusText”.

e) Select the Round Rect from the view window and bring up connection Inspector.Drag from the TouchUpInside to the File’s Owner icon and select buttonPressed: action. Now save the Button_Fun_iPadViewController.xib file, close it and go back to the Xcode.

Step 6: Open the Button_Fun_iPadViewController.m file and  make the following changes in the file:

 

 

 

Step 7: Now compile and run the application in the Simulator.

You can downloaded SourceCode from here Button Fun iPad

Leave a Comment:

8 comments
Colin says July 30, 2010

Hi,

I followed the steps above very closely (4 times) but I cannot do this section. The options are grayed out, so I can’t set them.

Step 5:

c) Now connect the File’s Owner icon to the View icon and select view.

d) Connect File’s Owner icon to label and select ”statusText”.

e) Select the Round Rect from the view window and bring up connection Inspector.Drag from the TouchUpInside to the File’s Owner icon and select buttonPressed: action. Now save the Button_Fun_iPadViewController.xib file, close it and go back to the Xcode.

Is there something obvious that you think I may be doing wrong? A rookie mistake? Any suggestions would be greatly appreciated.

Thanks,

Colin

Reply
Colin says July 30, 2010

Hi,

I followed the steps above very closely (4 times) but I cannot do this section. The options are grayed out, so I can’t set them.

Step 5:

c) Now connect the File’s Owner icon to the View icon and select view.

d) Connect File’s Owner icon to label and select ”statusText”.

e) Select the Round Rect from the view window and bring up connection Inspector.Drag from the TouchUpInside to the File’s Owner icon and select buttonPressed: action. Now save the Button_Fun_iPadViewController.xib file, close it and go back to the Xcode.

Is there something obvious that you think I may be doing wrong? A rookie mistake? Any suggestions would be greatly appreciated.

Thanks,

Colin

Reply
Sushant says July 30, 2010

I have attached screenshot in our blog for this application. Please read once again, if you have any problem then please let us know.

Reply
Brandon says September 1, 2010

I’m having the same problem as Colin with the step:
Step 5: c) Now connect the File’s Owner icon to the View icon and select view.

How do I get that blue line to appear to make the connection between the File’s Owner icon and the View icon?

Reply
Sushant says September 6, 2010

@Brandon and Colin please follow the below step.

1. Select the File’s Owner icon from the Button_Fun_iPadViewController.xib file.
2. Right click on the File’s Owner icon and drag the File’s Owner icon to the View icon, and select view.

Hope this will help you. Still you have problem then please let us know.

Reply
lak says September 23, 2010

hi sushanth,

i want to develop an settings view as like in ipad ..
any ideas how to develop this type app …

Reply
Mark says October 22, 2010

Thank you so much for this simple and effective tutorial. It worked for me first time!

I am using Xcode Version 3.2.3 (1688) on Mac OS X 10.6.4.

Reply
Mark says October 22, 2010

Thank you so much for this simple and effective tutorial. It worked for me the first time!

I am using Xcode Version 3.2.3 (1688) on Mac OS X 10.6.4.

Reply
Add Your Reply