Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

iPhone - Using UITableView to display table data with multiple columns

Posted on 2010-08-17
4
Medium Priority
?
4,486 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

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.
Set up iPhone and iPad email signatures to always send in high-quality HTML with this step-by step guide.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
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.

688 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