sapdev logo background
sapdev logo sapdev logo

Iphone Navigation based application to display simple list

Step 1 - Create a new Project
Within Xcode select the menu option File-> New Project. Ensure application is selected under iPhone OS and then select 'Navigation-based Application', press the Choose button and give it a name

Step 2 - Update RootViewController.m to Set number of rows displayed
Find the 'numberOfRowsInSection' function. This basically sets the number of rows that will be displayed on the root screen of the application. Change the return value from 0 to 4.

Step 3 - Update RootViewController.m to change text displayed on each row
Find the 'cellForRowAtIndexPath' function. This allows you to update the rows before they are displayed to the user i.e. change the text displayed on each row.

Enter the follow code between '// Configure the cell.' and 'return cell.'
// Configure the cell.

	if(indexPath.row == 0) {
 		[cell setText:@"Camping Int"];
 	if(indexPath.row == 1) {
 		[cell setText:@"Campsite 2"];
 	if(indexPath.row == 2) {
 		[cell setText:@"Campsite 3"];
 	if(indexPath.row == 3) {
 		[cell setText:@"Campsite 4"];

return cell;

Step 4 - Check code
Your RootViewController.m should now look like this

Step 5 - Save, Build and run
Right that's it. Simply save everything and Click 'Build and Go' and your App should be displayed as below.

Step 6 - Adding user interactivity
This is obviously a very basic example of a navigation based application and does not allow the user to navigate from this screen. The next step is to add a second view which is displayed when the user clicks on a specific row. Navigate to a second view

Can't find something on ERPWorkbench? A quick search should fix that: