开发者

(view-based) NSTableView's reloadDataForRowIndexes:columnIndexes: not removing row view?

Trying to use reloadDataForRowIndexes:columnIndexes: for my view based NSTableView in 10.7. Having redraw problems though. If I edit the object and call reloadDataForRowIndexes:columnIndexes: and later delete the object, I end up with a static row view.

To docs warn:

For view-based table views, reloadDataForRowIndexes:columnIndexes: will drop the view-cells in the table row, but not the NSTableRowView 开发者_运维百科 instances.

Not sure how I should tell the table view to drop the row view too. If I use reloadData everything works but obviously it's a lot heavier a method to call and causes loss of selection.

Any thoughts?

UPDATE: Added a demo app to demonstrate the bug. Can be found on GitHub. It has workaround code but none-the-less I'd still like to find the answer.

https://github.com/zorn/NSTableView-ViewBased-ReloadRowBug


I think I fixed this bug. Turns out you have to be careful about closing with [self.tableView endUpdates] before attempting any kind of reloadDataForRowIndexes:columnIndexes: on the tableview.

I'll append my radar requesting a formal console working be logged when attempting to do such a thing.

GitHub project has been updated.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜