views:

227

answers:

1

This guide from apple https://developer.apple.com/iphone/prerelease/library/documentation/UserExperience/Conceptual/TableView_iPhone/TableViewCells/TableViewCells.html (you need login) explains how to use "The Technique for Static Row Content" to use Interface Builder to setup the cells in a tableview.

I have some cells with different heights in my tableview. Without using the heightForRowAtIndexPath method everything get messed up. Do I still need to use this method or can I in some way setup the height of the cells inside the IB as I created them there?

Also when using the "The Technique for Static Row Content" from the guide you still need to use the cellForRowAtIndexPath to setup the cells even if they are created in IB. I would like to setup the full layout of the tableview with all cells in IB (drag the cells right into the tableview), is that possible in some way?

Thanks!

A: 

While it would be nice if Interface Builder could do all that, it doesn't. To make things look correct, you have to implement the heightForRowAtIndexPath and cellForRowAtIndexPath. To make things easier for yourself, you could make an array and just look these things up (assuming you don't have too many rows in the table).

-dan

Daniel Blezek