I want to put a attributed string on a nstextview, and manually calculate the height of the textview and row
-(CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row
inside
-(NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
{
WBMessageTableCellView *result = [tableView makeViewWithIdentifier:@"wbCell" owner:self];
//do some calculation, and update textview's frame
textView.frame = CGRectMake(57.0f, 36.0f-height, 380.0f, height);
}
height is the calculated result for NSTextView.
everything is fine for the first time,
but if I scroll, the TextView starts move down,
it has been bugs me for a day, does anyone knows why? thanks in advance.