How To Use The iPhone OS UITableView (Video)

Matthew Campbell, May 11th

You see UITableView in all sorts of utility iPhone applications. It is used to display data, lists of items and even to format objects on the touch display. UITableView is one of the things that you can learn that will bring you a ton of leverage in your iPhone app development projects. Today I am going to show you the basics (scroll down to see the video) of using UITableView.

UITableView uses the delegation pattern that is very common through iPhone SDK. Generally, the idea is that you will need an object to act of behalf of your UITableView; we will call this object a delegate. When the system needs to know something, like how many rows are in the table, it will simply “ask” the delegate using a specified callback or delegate method.

Delegation is a really useful skill to master and it is used throughout iPhone development. If you need help with delegation and other iPhone SDK design patterns check out these resources that will help you. You may also want to check out the tutorial section on this website.

You will need to have iPhone SDK 3.2 installed. Also, before we start make sure to have created a window-based iPhone application.

  • Create Window-based iPhone application
  • Add New UITableViewController Subclass
  • Implement numberOfSectionsInTableView
  • Implement numberOfRowsInSection
  • cellForRowAtIndexPath
  • Import UITableViewController Subclass into your app delegate
  • Create an instance of your UITableViewController Subclass
  • Add your UITableViewController Subclass object to the UIWindow
  • Build and Go
  • Having trouble seeing the video? Click here to download the mp4 file to your desktop to see the video in your favorite player.

    [...] explained with [...]

    You must be logged in to post a comment.

  • Hours of videos, demos & screen casts
  • SOURCE CODE
  • Detailed HANDS-ON Exercises
  • Much Much Much More
  • UIKit
  • Objective-C
  • Core Data
  • More!
  • Learn How To Make An iPhone App right now using my proven system.

    PS: Tons of us are having a blast living off our own code, join us now. Click here to get all the details.