In this tutorial I will walk to you through creating a simple “Hello World” application using a UITableView for the iPhone. There are many ways that a Hello World program could be made on the iPhone, I am going to show you the simplest. This tutorial assumes you have a basic understanding of Objective-C. Apple has provided a very simple and straight forward tutorial on Objective-C. You can find it here.
You will learn how to:
- Create a New Navigation-Based Application
- Learn About the Default Files
- Update the UITableView Cells to Display “Hello World” Text
This tutorial assumes that you have already installed the iPhone SDK. If you are unsure how to do this, click and follow the steps.
Creating a New Navigation-Based Application
Open Up Xcode

You will be doing all of your development in Xcode. Then close the Welcome window (if it shows up)
Start a new iPhone OS Project
Click Xcode > New Project and a window should pop up like this:

Make sure Application is selected under iPhone OS and then select Navigation-Based Application. Click Choose… It will ask you to name your project. Type in “Hello World” and let’s get started.
Learn About the Default Files
What is all this stuff?
There are quite a few files that get added to your project. At first glance, this looks kind of intimidating. Don’t worry, we only need to edit one of them. Here is a quick explanation of the different files. You don’t have to read this part but having this many files is what confused me the most when I started developing for the iPhone.
- CoreGraphics.framework, Foundation.framwork, UIKit.framework – You guessed it, this is a set of library functions provided by Apple that we use in our application. We use these as includes similar to any other language that includes library functions.
- HelloWorld.app – This is your app that gets installed on the iPhone. We don’t really need to worry about this right now
- Hello_World_Prefix.pch – This is another include file that gets compiled separately from your other files so you don’t need to include it on each file. It contains some code to include the data inside the frameworks.
- Hello_WorldAppDelegate.h – This is a header file that contains all of our definitions for variables that we will be using. It’s very similar to a header file in C or C++;
- Hello_WorldAppDelegate.m – All of the magic starts here. Consider this file our starting point for execution. The main.m file invokes this object.
- Info.plist – This contains various meta information about your program. You won’t really need to edit this until you are ready to start testing on the iPhone
- main.m – Like most programming language, this file contains our main function. This is where execution begins. The main function basically instantiates our object and starts the program. You shouldn’t need to edit this file.
- MainWindow.xib – This contains the visual information of our main window. If you double click on it, it will open in a program called “Interface Builder”. We will get to this a little later. Just on thing to note is this file does not contain any code.
- RootViewController.h, RootViewController.m - These are files for a view controller that gets added to our main window. Basically, Apple has already created a simple interface when you clicked on Navigation-Based Application. Since most navigation-based applications use a Table View, Apple has provided it for us to use.
- RootViewController.xib – This is a view that Apple has provided that emulates a table. It has rows and columns. We will be displaying our “Hello World” text inside one of these rows







113 Comments
Thank’s so much!
Nice tutorial for the beginners to learn. You have explained everything in detail.So everyone can understand. Please post so many examples. Thanks a lot for your wonderful work.
Nice tutorial, even better than the ones in the official iPhone tutorials. Keep it up,.
Are you really doing this for free? You can probably start a professional iPhone dev course of yours. Apple docs can look pretty scary to a newbie.
Your are really helping a lot of people. Apple should really pay you for doing this.
Why don’t you have atleast a ‘Paypal Donate’ button on this blog? I am sure many readers would like to encourage you to keep writing these handy tutorials.
i really really really enjoyed it thats very very very nice!!!!!!!!!!!
Hi pplz!
THIS WAS AN AWESOME TUTORIAL!!!
but…
i’m trying make an add button like how there is on “contacts” ( + sign ) and when someone presses the add button it creates a new cell. How would i do that? Please could someone help me out?
Thanks!
Hello,
Thank you for making this tutorial however I have encountered an error and I was wondering if you might be able to help.
[cell setText: @"Hello World"]; isn’t working for me because I have the iPhone OS 4 beta 2 installed and setText is deprecated.
It tells me to use the property textLabel however I am unsure how to use it appropriately.
Thank you for your help…
nevermind sorry,
cell.textLabel.text = @”hello world”; worked fine, just needed to hunt a little bit!
Nice! Thanks for posting this…
I got what i am looking for great.
Keep It Up.
very nice.. it’s very helpful
You are doing awesome work! Thank you very much for sharing so much great information with people in a nicely presented and well thought out way.
Hello there. I have just come upon your tutorials (after a confusing few days on Apple’s site). I’m very much looking forward to going through them. They seem really straight forward, easy to follow. Thanks.
14 Trackbacks
[...] Update: Here is another step by step that applies to the SDK V. 2.0: http://icodeblog.com/2008/07/26/iphone-programming-tutorial-hello-world/ [...]
[...] my last tutorial UITableView Hello World I said that there are many ways to write a “Hello World” tutorial for the iPhone. [...]
[...] Hello World Tutorial Using UITableView [...]
[...] We will be utilizing Apple’s UINavigationController. I will be using the code from the “Hello World” tutorial that I previously wrote. So if you have not completed it yet, go ahead and do it [...]
[...] iPhone Programming Tutorial – UITableView Hello World [...]
[...] UITableView Hello World [...]
[...] specifically this post (coral). This is another blog to keep in your bookmarks folder, but the specific post above also [...]
[...] Create a New Navigation-Based Application [...]
[...] 18, 2008Manymoon – Online To Do List, Task and Project Management with Google Docs December 18, 2008iPhone Programming Tutorial – UITableView Hello World | iCodeBlog December 18, 2008CAREER TOOLBOX: 100+ Places to Find Jobs December 17, 2008Official Gmail Blog: New [...]
[...] Neste artigo do iCode você encontra os passos para criar seu primeiro ‘Hello World’ para iPhone. O artigo mostra passo a passo como criar a aplicação, quais os arquivos gerados e o porquê de sua existência. O detalhe é que são poucas linhas de código, e o resultado sai naquela tabelinha que caracteriza as aplicações iPhone. [...]
[...] iPhone Programming Tutorial – UITableView Hello World | iCodeBlog (tags: programming development iphone) [...]
[...] We will be utilizing Apple’s UINavigationController. I will be using the code from the “Hello World” tutorial that I previously wrote. So if you have not completed it yet, go ahead and do it and [...]
[...] UITableView Hello World [...]
[...] Create a New Navigation-Based Application [...]