I have a label on a UITableView. When clicked it will refresh my tableview and set the top cell's height. When I am setting the cell height, I am checking if a certain variable is TRUE. If true it will show the large height, if false, the smaller height.
At the time of cell height creation, my variable is always false. It is a member variable and its value is being set when the user clicks on the label.
How can I make sure that the variable is set before the table refreshes?
- (CGFloat)tableView:(UITableView *)tblView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
CGFloat rowHeight = 0;
if(indexPath.row > 0)
{
TweetCell *cell = (TweetCell*)[self tableView:tblView cellForRowAtIndexPath:indexPath];
rowHeight = cell.totalHeight;
}
else {
if (reloadProfile) {
rowHeight = profileCellHeight;
}
else{
rowHeight = reloadCellHeight;
}
}
return rowHeight;
}