Here are two ways to relate to TableView.
-(UITableViewCell *) TableView: (uitableview *) TableView Cellforrowatindexpath: (Nsindexpath *) Indexpath and
-(cgfloat) TableView: (uitableview *) TableView Heightforrowatindexpath: (nsindexpath *) Indexpath
We need to understand the sequence of calls for these two methods, first Heightforrowatindexpath and then Cellforrowatindexpath.
Dynamically get the cell's height
-(CGFloat) TableView: (UITableView *) TableView Heightforrowatindexpath: (Nsindexpath *) indexpath{ UITableViewCell *cell = [self Tableview:tableview cellforrowatindexpath:indexpath]; return cell.frame.size.height;}
-(UITableViewCell *) TableView: (UITableView *) TableView Cellforrowatindexpath: (Nsindexpath *) indexpath{ static NSString *cellidentifier = @ "Homecell"; UITableViewCell *cell = [TableView dequeuereusablecellwithidentifier:cellidentifier]; cell = [[UITableViewCell alloc] initwithframe:cgrectzero]; Set cell data to return cell;}
IOS sets the cell's height based on cell content