calling the properties of a TableViewCell in a ViewController

1

I'm trying to create a tableview with the dynamic cell according to the text inside it, and I'm wanting to add the height of the label to the size of the cell, but when I call the label in the ViewConrtoller it is empty and when I call TableViewCell it gives me the right size, how to pass the (label.frame.size.height) from TableViewCell to the viewcontroller without losing its value.

    
asked by anonymous 04.08.2015 / 16:37

1 answer

0

You can try this on cellForRowAtIndexPath:

    cell.Label-em-questao.tag = 789;
    [self sendCELL:cell];

then you retrieve the data in:

- (void)sendCELL:(UITableViewCell *)sender {
    CGRect tag = [(UILabel*)[(UITableViewCell *)sender.superview viewWithTag:789]frame];
    int width = tag.size.width;
    NSLog(@"%d", width);
}
    
04.08.2015 / 20:02