Solved

iPhone - Using UITableView to display table data with multiple columns

Posted on 2010-08-17
4
4,281 Views
Last Modified: 2013-11-25
What is the best way to display some data in a table type format on the iPhone?
I have 3 columns and lots of rows.
Should I create a custom UITableViewCell with 3 'columns' in it?
How should I display the column titles?

Thanks,
Matt
0
Comment
Question by:mattasks
  • 2
  • 2
4 Comments
 
LVL 33

Expert Comment

by:pgnatyuk
ID: 33461818
You need to use UITableView.
I think, this is a very simple tutorial for a beginning:
iPhone Programming Tutorial – UITableView Hello World
http://icodeblog.com/2008/07/26/iphone-programming-tutorial-hello-world/
http://www.codeproject.com/KB/iPhone/UITableView_Hello_World.aspx

You can add columns in the interface Builder.

Then here you will find a set of tutorials:
http://adeem.me/blog/2009/05/19/iphone-programming-tutorial-part-1-uitableview-using-nsarray/
0
 

Author Comment

by:mattasks
ID: 33462032
Hi pgnatyuk,

Yes, as my question title indicates, I'm using UITableView.  But UITableView consisted of single columns only (one UITableViewCell per row).
I'm asking specifically about whether I should I go to the level of UITableViewCell to create custom details (ie multiple columns).

The links you provided are trivial tutorials for creating simple tables.  I'm asking a bit more in depth than that.
0
 
LVL 33

Accepted Solution

by:
pgnatyuk earned 500 total points
ID: 33462182
Also I forgot about the difference between UITableView and NSTableView. :(
Sorry.

I'd say to subclass UITableViewCell to override draw methods.

I found this blog post interesting:
Drawing a Grid in a UITableView
http://usxue.is-programmer.com/posts/14176.html
From my point of view, it's exactly your question.

More:
http://www.iphonedevx.com/?p=153
http://www.iphonesdkarticles.com/2008/08/table-view-tutorial-tableview-cell.html

Last link looks not bad and not very long.

0
 

Author Closing Comment

by:mattasks
ID: 33462347
Great, that's what I'm wanting to do.  Thanks for the links.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Learn new improvements released by Google for Google Calendar. Noted in this article are simple tips and tricks that can make your everyday use of Google Calendar better.
Are you having trouble connecting or getting your iPhone / Samsung device(s) to sync with Microsoft Exchange Server?   What have you tried?   What haven't you tried?
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now