I have a UITableViewController with a subclass of UITableViewCell with a UITableView in each cell. I have both UITableViews working just fine. The problem comes when I rotate it. If I set the frame of the tableViewInCell to a width larger than the height of the containing cell, then it goes heywire. See below.
Width of tableView set to a value <= height of containing tableViewCell:
tableViewInCell = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 132, 132) style:UITableViewStylePlain];

Width of tableView set to a value > height of containing tableViewCell:
tableViewInCell = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 132, 320) style:UITableViewStylePlain];

How do I get the tableViewInCell to fill the width of the containing UITableViewCell and not go heywire?
UPDATE:
tableViewInCell = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 320, 132) style:UITableViewStylePlain];
![tableViewInCell = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 320, 132) style:UITableViewStylePlain];](https://i.stack.imgur.com/9hrN2.png)
UPDATE 2: Here is the method where I set up the tableViewInCell.
-(void)setupTableView {
tableViewInCell = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 320, 132) style:UITableViewStylePlain];
[tableViewInCell setDelegate:self];
[tableViewInCell setDataSource:self];
tableViewInCell.transform = CGAffineTransformMakeRotation(-M_PI * .5);
[self addSubview:tableViewInCell];
}
Change your current
setupTableViewto