Lesson 3 – Your First iPhone App

In this lesson you will learn how to write and build your first app. Here you will be introduced to the workflow in iPhone development and you will learn how to start building a Hello World app.

Lesson 3 Notes

How to Build Your First App [Hello World!]

  • Start XCode
  • Select File
  • Select New Project
  • Choose Window Based App and name it HelloWorld
  • Save it to your desktop
  • Select the file HelloWorldAppDelegate.m
  • Go to the ApplicationDidFinishLaunching method
  • Enter in the code below:
  • 	UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Message Box"
    	                                                message:@"Hello World!"
    	                                               delegate:self
    	                                      cancelButtonTitle:@"Get Rid of Me"
    	                                      otherButtonTitles:nil];
    	[alert show];
    	[alert release];
    

    When you build and run the app it will look like this in the simulator:

    Hello World Screenshot


    XCode Screen Guide
    Click here to download the source code for this lesson


    XCode Screen Guide
    Click here to download the recommended reading for this lesson

    Take Action

    Start practicing coding by playing around with the UIAlertView code you just encountered. Change the various messages and titles to continue to get familiar with XCode and programming.

    Discussion: Do You Have Experience With Object Oriented Programming?

    Use the comment field below to discuss what you learned in this lesson and anything else that you can share about object oriented programming. You may also use this comment field to ask and answer questions about the course material.

    Click here to go right to Lesson 4

    Click here to return to Module 1