Solved

iPhone - Using UITableView to display table data with multiple columns

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
iPHone 6S IOS 9.3.4 - News Feed Preferences 2 48
can't find the executable in Simulator 1 80
Old GPS chip on Samsung Tab 4 - Kit Kat? 2 35
iPhone 7 64GB 5 102
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
Let me explain this picture a little bit.  First, in case you haven't already guessed, you are looking at my 2 phones, an Android Samsung Galaxy S5 on the left and an iPhone 5 on the right.  They are on their respective cradles on my desk.  But, you…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.

896 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

12 Experts available now in Live!

Get 1:1 Help Now