使用自动布局时 NSTableView 重绘过于频繁

NSTableView redrawn too often when using auto layout

每次我更改 NSTextfield 的值时,都会重绘整个 tableView(基于视图)。

这可能是由于 intrinsicContentSize 可能会改变。

我试过了,但没有任何改变

- (NSSize)intrinsicContentSize
{
    return NSMakeSize(NSViewNoInstrinsicMetric,NSViewNoInstrinsicMetric);
}

TableView 大小样式设置为自定义宽度固定行高。

TexField 的约束是

V:|-20-[myTextField(14)]

H:|-20-[myTextField(50)]

我也试过在

中不调用 super
invalidateIntrinsicContentSize
and 
invalidateIntrinsicContentSizeForCell:(NSCell *)cell

并尝试手动将 setNeedsLayout 设置为 NO

- (void) setObjectValue:(id)objectValue
{
    [super setObjectValue:objectValue];
    [self setNeedsLayout:NO];
    [self setNeedsUpdateConstraints:NO];    
}

而且tableView还在重绘...

我该怎么做才能避免这种情况?

我在使用启用了 "flash screen updates" 的 Quartz Debug 时看到正在重绘的屏幕部分,并且整个 tableView 都在闪烁。

覆盖tableview和textfield的drawRect后,发现dirty rect和Quartz flashing Rect不一样。 TableView 未完全重绘。