Matt Langtree

iPad Large Table Data [Sample Project]

So you have a large XML feed with lots of rows/columns that you want to turn into an iPad app. Let’s see what options we have for presenting this data.

  1. Start with UITableView and create a subclass of UITableViewCell to layout all of the columns. Sure, but maybe you’ve got more columns than you can show on a single iPad screen. UITableView is not going to be an elegant solution here.
  2. OK, you’ll just hook up an NSTableView right? ba-bum! — It’s Mac only.
  3. Maybe you could grab Daniel Tull’s DTGridView and add a bunch of UILabel’s to a grid view. This is pretty good, but there is an easier way..
  4. Try a UIWebView and use HTML, CSS and Javascript? Well this is the easiest of the lot, so let’s give this a go. What I have created is a hybrid native/web app. We take an iPad app shell, throw in a UIWebView, and use HTML, Javascript, and some CSS to come up with a great looking table of information. I have used HTML 5, jQuery,  Twitter’s Bootstrap and Last.fm’s XML API for events at venues.

{ % img http://mattlangtree.com.au/wp-content/uploads/app-breakdown1.jpg % }

The example project DataTable isn’t modelling a particularly large dataset, but it’s a good start. Additionally, you can use this as a reference for future iPad web apps.

DataTable: View on GitHub | Download Source (Requires Xcode 4.1 or higher)