문제

The context

I have an error with the datasource of my NSTableView.

The error is

* Assertion failure in -[NSTableView _uncachedRectHeightOfRow:], /SourceCache/AppKit/AppKit-1265.19/TableView.subproj/NSTableView.m:1784

at the line self.tableView scrollRowToVisible:0] ;.

The strange description

When I try to debug this error and type in the debugger

po [self tableView:self.tableView viewForTableColumn:[self.tableView tableColumns][0] row:0]

I get

<NSTableRowView: 0x6000001b7300> - row: -1.

My question is:

  • What is this row: -1? (I don't see any row property in NSTableRowView)

  • What kind of hints can this information gives me on the first error?

도움이 되었습니까?

해결책

If you are using a NSTableViewDelegate , then tableView:heightOfRow can not return zero.

It would be a neat way to make rows disappear, but alas. I mention it because the assertion failure is in -[NSTableView _uncachedRectHeightOfRow:].

You might also have issues with the row height being zero in recycled cells.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top