views:

343

answers:

1

Hi,

At the moment, I have a settings view in my iPhone app built with Interface builder, it consists of a background image, some text fields, labels and buttons. Because this looks bad, I want to convert the settings view to an UITableView with custom UITableViewCells.

I already tried adding some cells into my settings view's XIB and returning them in the cellForRowAtIndexPath method (with [return myCell];), as written in Apple's tutorial, but this was not working for me - my whole TableView looked strange and it only showed the first cell correctly.

Is it possible to design these custom cells in Interface Builder? Do I have to create an empty XIB for them or can I put them in my view's XIB? And how do I insert them into my TableView?

Thanks in advance,

Yassin

+1  A: 

You can absolutely add custom table cells that you built in interface builder. This includes both static cells and Dynamic cells. However without you providing more information the best I can say is "double check the docs and try again." I can only say that it works and it's rather straightforward so it's hard to say what you may have missed. It might be more helpful if you post what you have for the tableView:cellForRowAtIndexPath method.

Since you say you just have some text fields, I would recommend looking at the technique for static row content section of the Table View Programming guide. You probably would want to have each field of your form correspond to a row in a Segmented Table View, it'll make everything look nicer.

bpapa
Yeah, I got it working. I tried following the docs again and this time, I noticed that I made some mistakes when returning the cells. So, thanks for your motivation to check the docs again ;-)
Yassin