I am using UITableViewController
instead detailView to show one entity details. I populated one row of data from PFQuery in my viewDidLoad
method.
Below is how I do.
// this will set height of the row
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
String *yourLongString = "Long text here";
UILabel *mLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,0,320,30)];
your size will change here
mLabel.hidden = YES;
mLabel.text = yourLongString;
[mLabel sizeToFit];
^^^^^^^^ this is very important
return mLabel.frame.size.height;
}
Now in cellForRowAtIndexPath
adjust the height of actual label as per the height of the cell.
Let me know if you are not clear.