I am relatively new to Objective C/iOS development so I realize that this may seem like a basic question: For iOS 5+, I’m looking for a primer on how to create a tableview that has cells with a variety of data. For example, in my data array I might have data like:
- Restaurant Name (basic string)
- Restaurant Logo (string name of an image file)
- Restaurant Rating (an integer)
In a single cell, I want to display the logo of the restaurant, then the name, and then show a number of stars based on the rating integer (ie a “4” would display a single star image 4 times).
I can’t tell if I can do this with the standard table cell or if I need to create a custom table cell object.
Help!
Here is a good place to start.
http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html
One point they make is that if you subclass
UITableViewCellthen you have done something wrong. Instead, read it as most of the time customizing the standardUITableViewCellis sufficient.For spectacular customization then deriving a class from
UITableViewCellis fine.