[Note: If you want more tutorials on UITableView or UITableViewCell, then add a comment on "Request Tutorial" Page]

So, this tutorial is about Grouping in UITableView. UITableView have lot of features and options, so you can easily make any kind of User Interface you want for your application. Out put of this tutorial will look like this

Follow these steps to create a grouped table:

1. Open the SimpleTable project in Xcode ( you can grab this code from here). Open SimpleTableViewController.xib file and select UITableView. Press cmd + 1 and change its style to ‘Grouped’. Save this file and close it.

2. Open Xcode and select ‘SimpleTableViewController.h’ file and rename the arryData to arryAppleProducts. Also add ‘arryAdobeSoftwares’ NSArray. So this class will look like this

3. Now open SimpleTableViewController.m file and click cmd + f. In Find type arryData and in Replace type arryAppleProducts and then press ‘Replace All’ button. You can run this code to see how group table will look like.

4. Now add another NSArray(arryAdobeSoftware) in viewDidLoad method. So this method will look like this:

9. Now I am going to add header for each section, so that group table have some heading text. For that you have to add a method name ‘titleForHeaderInSection’ in your code. I added this method after method ‘numberOfSectionsInTableView’. So code for titleForHeaderInSection will be:

You will see a logical error, if you select any row from both section. It will be displaying only the apple products on navigation view. So for that you have to add a condition in didSelectRowAtIndexPath method:

My name is Adeem M Basraa. I am a software engineer from Lahore, PK. I’ve been involved in software development for nearly 4 years, with the last 1 year focused on application development for mobile devices (iPhone & Android).

You have written very helpful tutorials. I would like to request you a tutorial on UITableView which functionality is something like native add contact screen in contacts app. But I want it something like this way – first section contains two cell with textfield and label (like first name,last name) and the three sections will have a header view with a + button on the right corner. when you tap on + button a new cell will be inserted into the corresponding section. The cell contains a button(work as in add new contact screen when you want to change the type of phone/email),a textfield and a delete button. tapping delete button on corresponding cell will delete the cell. I have already tried to creating a demo code but fails to complete it 100%. Please create a tutorial for uitableview for inserting custom cells with textfields along with delete cells and finally get all the textfields data and their type into dictionary/array. Thanks

I have a UITableView that I populated using a plist which includes a header, an image, title. detail, and controller so that when a specific cell is selected it calls on the included viewcontroller to load the corresponding NIB. Since most of the NIBs will have the same format just different information populating the various parts is it possible to only load one view controller and NIB and have a plist that contains the information needed. The NIB Will have a UIImageView, a UITextView, a button to play an audio file, and a button to flip the view over to reveal a map with an annotated pin at a specific location. So can I have the same view controller load the same NIB but display a different image, text, play a different audio, and flip to a different map coordinates from a plist depending on the cell chosen. I hope I am being clear enough. Could you point me in the right direction as to where I need to research/look to do this if posssible.