Solved

iPhone - Using UITableView to display table data with multiple columns

Posted on 2010-08-17
4
4,338 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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?
Email is way too noisy, prone to hiding the important stuff, and really becoming unreliable for critical/timely communications. There are better ways to communicate.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

830 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