Solved

iPhone - Using UITableView to display table data with multiple columns

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Let Bitmoji into your life. Now is the time to learn a new language of smartphone messaging with this brief introduction.
Is your phone running out of space to hold pictures?  This article will show you quick tips on how to solve this problem.
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.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

710 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