If my tutorial help you then please donate, so that i continue writing free tutorials for every developer/programmer/freelancer
Creating iPhone Application: Introduction:
I am going to write series of UITableView tutorials for iPhone (Video Tutorials as well) to help developers and programmers to make a new applications for Apple store. This series of tutorials help you create/build iPhone applications more easily and fast. Following are the list of iPhone tutorials, which I will be posting on this blog:
iPhone Programming Tutorial -Table View- Part 1: Create a Simple UITableView [Populate UITableView With Array]
iPhone Programming Tutorial -UITable View- Part 2: Navigatation in UITableView [Navigatation on UITableView using didSelectRowAtIndexPath]
iPhone Programming Tutorial – Part 3: Grouped UITableView [Using Interface builder]
iPhone Programming Tutorial – Part 4: Tips for UITableView Design [Change UITableView properties i.e background colour, accessory type, add footer and header]
iPhone Programming Tutorial – Part 5: Add, Delete & Re-order UITableView rows
iPhone Programming Tutorial – Part 6: Creating UITableView using UITableViewCell Using Interface Builder
iPhone Programming Tutorial – Part 7: Adding Pictures into your UITableView using Interface builder
iPhone Programming Tutorial Examples Part 8: UITableView & UITableViewCell examples and tips
[Note: If you want more iPhone tutorial's on UITableView or UITableViewCell, then add a comment on "Request for Beginner iPhone Tutorial" Page]
Idea of this iPhone tutorial:
In my last iPhone tutorial on table, I explain how you can easily design table using UITableViewCell. In this tutorial, I will explain how you can add images and labels to your UITableView. So in this tutorial, i will add few lines in UITableViewCell class and add images to cell xib file.
Final output of this tutorial will look like this. You can watch the video tutorial at the end.
iphone programming tutorial steps to follow (10 Steps to add pictures):
Follow these steps to achieve the output like above:
Step 1:Open the last tutorial code (You can grab this code from here) and add following 6 images to your project resources folder by dragging in to xcode.






Step 2: Now open TableCellView.h file and add one Label & UIImageView
IBOutlet UIImageView *productImg; IBOutlet UILabel *descriptionText;
Also Add these two methods definition in TableCellView.h, for setting the values for label and Image.
- (void)setDescpText:(NSString *)_text; - (void)setProductImage:(NSString *)_text;
Step 3: Add these methods body in TableCellView.h file
- (void)setDescpText:(NSString *)_text;{
descriptionText.text = _text;
}
- (void)setProductImage:(NSString *)_text;{
productImg.image = [UIImage imageNamed:_text];
}
Step 4: Add two NSArray’s in SimpleTableViewController.h
NSArray *imagesList; NSArray *descpList;
Step 5: In SimpleTableViewController.m file, move to viewDidLoad method and overwrite the arryData with these lines of code:
arryData = [[NSArray alloc] initWithObjects:@"iPhone",@"iPod",@"MacBook",@"MacBook Pro",@"Mac Mini"@"iPhone 3G S",nil]; imagesList = [[NSArray alloc] initWithObjects:@"1.jpg",@"2.jpg",@"3.jpg",@"4.jpg",@"5.jpg",@"6.jpg",nil]; descpList = [[NSArray alloc] initWithObjects:@"Price 500$",@"Price 50$",@"Price 1,000$",@"Price 1,200$",@"Price 800$",@"Price 700$",nil];
Step 6: In cellForRowAtIndexPath method, add these two lines before return statement
[cell setProductImage:[imagesList objectAtIndex:indexPath.row]]; [cell setDescpText:[descpList objectAtIndex:indexPath.row]];
Step 7: Now open TableCellView.xib file in Interface Builder. Select “Table Cell View” and change its height to 65.
Step 8: Add UILabel and UIImageView to the cell design like this
Step 9: Map UILabel & UIImageView to TableCellView.h file
Step 10: Last step, open SimpleTableViewController.xib file and select Table. Press cmd + 3 and change the height of row to 70.
Run the application and you will see the final output.
Code for iPhone application:
Click here for the code Project code.
Follow iPhone programming tutorial video here:
Click here to watch the video tutorial to add images in your iphone application.
Popularity: 81% [?]
Related posts:
- iPhone Programming Tutorial: Part 6: Creating custom UITableViewCell Using Interface Builder [UITableView] This tutorial will help you to create custom rows in...
- Adding Pictures to Table iPhone Add Picture in Table, Video Tutorial: Application developed to...
- iPhone Programming Tutorial – {Part 1} UITableView using NSArray Creating iPhone Tutorial Introduction: I am going to write series...
- iPhone Programming Tutorial: Complete List of UITableView Tutorials + Videos Complete List of UITableView tutorials plus few video tutorials as...
- iPhone Programming Tutorial: {Part 3} Grouped UITableView I am going to write series of UITableView tutorials (Video...








Its seems prety easy now with screen shorts and vedio
thanks for sharing …..:)
[...] 2: Now open TableCellView.h file and add one Label & UIImageView view sourceprint? 1.IBOutlet UIImageView *productImg; 2.IBOutlet UILabel [...]
Fantastic job! This is a great tutorial!
My question is this: How can I make it so when the user clicks on a cell they get a detailed view that corresponds to the cell they clicked on? I see that you have the title but I’d like to add more information to the view than that.
Thanks!
@Brian,
so please check it out this week again!
I am going to write last tutorial on this
Awesome. Thanks!
Don’t know how deep you’re gonna go with the next tutorial. BUT…there doesn’t seem to be any tutorial out there right now that shows a detail view with custom cells. So say if a user clicked on a cell from the initial tableview they’re taken to a detail view that has phone number, address, image, etc. The only tutorials I’ve seen are really clunky and don’t show how to “stylize” the data on the detail view so it looks nice.
Anywhoo…Cheers and thanks again!
Great Tutorials! You make it look easy.
I’m having trouble applying this tutorial to a Group Table View. I’m not getting the nice rounded corners. Is there a simple fix?
BTW. I had to adjust your code for 3.0. In TableCellView.m initWithFrame has been depreciated, it’s now initWithStyle. Oh and Step 3 above should read TableCellView.m
Thanks again!
When do you think you will have the next tutorial posted? I’m definitely willing to make a donation.
Good idea buddy!I learned a lot from this blog and definitely it’s going to help me.
Hello,
I have followed your tutorials and have found them really useful.
However, I need some advice. Using the above tutorials as an example, I will like to modify the text in the descptext label (for all cells) whenever the user taps the return button on the keyboard.
However, I can’t seem to call the setDescpText method from the textFieldShouldReturn method (when the user taps the return key).
Will appreciate any help, thank you =)
Your tutorials have been a great help. This one and especially your sub views with custom-cells in IB.
I can see with your download example how you bring your arrydata across into the subviews, but how would you change that to bring the image thumbnails across also?