NSOutlineView reloadItem: has no effect

后端 未结 4 1091
孤独总比滥情好
孤独总比滥情好 2020-12-29 07:30

I\'m trying to release some strain on a view-based NSOutlineView for which I changed a single item property and which I initially reloaded just fine using

4条回答
  •  执念已碎
    2020-12-29 08:05

    I encountered this same problem with a view-based outline view, where calling -reloadItem: seems to just not do anything. This definitely seems like a big bug, though the documentation doesn't explicitly say that reloadItem will reacquire the views for that row.

    My workaround was to call NSTableView's -reloadDataForRowIndexes:columnIndexes: instead, which seems to work as expected, triggering a call to the -outlineView:viewForTableColumn:item: delegate method for just that item. You can get the row that needs to be reloaded by calling -rowForItem: and passing in the item you want to reload.

提交回复
热议问题