Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITableViewCell outside of UITableView

I notice that InterfaceBuilder has UITableViewCell in its library of objects I can drag onto a view. I wonder if it ever makes sense to use one outside of a UITableView.

like image 711
iter Avatar asked May 05 '10 04:05

iter


People also ask

Is it possible to add UITableVIew within a UITableviewCell?

yes it is possible, I added the UITableVIew within the UITableView cell .. :) no need to add tableview cell in xib file - just subclass the UITableviewCell and use the code below, a cell will be created programatically.


1 Answers

I have tried this and yes it does not appear to work. Which is, of course, fair, given the purpose and use of cells.

A reason for wanting to do this, in my case I have the cell used in a table view, selecting a cell then pushes on another view, part of which is an exact repeat of the contents of the cell, shown at the top.

So it would be very convenient to simply place the cell at the top on the new view, and have it populated, without needing any extra code.

What I have done is loaded the cell from its nib, set it up, and then added the contentView of the cell to my new pushed view. This achieves the desired effect.

like image 59
theLastNightTrain Avatar answered Oct 03 '22 02:10

theLastNightTrain