views:

40

answers:

1
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCellFixed *cell = (UITableViewCellFixed *)[tableView cellForRowAtIndexPath:indexPath];

the second line (ie: the first line after the function is declared) is repeating itself indefinitely. I have no idea why.

I got a stack overload when I was running the script, and when I put a breakpoint on this line and subsequent lines in the same method this line just continuously repeats and the breakpoints never move onto the next one.

I have no idea why this is, but this is my first time trying to subclass a UITextViewCell, so I'm assuming I've done something wrong?

Thanks Tom

+3  A: 

When you ask your table for a cell, the table itself calls heightForRowAtIndexPath to be able to display the cell in correct height.

tob
oh right... :p *embarassed* so, how would I get the cell textLabel and detailTextLabel objects?
Thomas Clayson
You should get the contents of these labels from your model rather than from the cell itself.
tob
in –tableView:cellForRowAtIndexPath:
Simon
@tob : ah fair enough, good idea. :) @simon, thanks but I need the text in order to set the appropriate height. :)
Thomas Clayson