How can you get indexes of visible rows for an NSOutlineView?

前端 未结 4 1753
广开言路
广开言路 2021-02-08 20:42

How can you get a indexes of visible rows for an NSOutlineView? I need to know which level and which rows are visible.

[EDIT] What I\'m actually looking for is an NSOutl

4条回答
  •  孤城傲影
    2021-02-08 21:21

    I changed my datasource to return an NSIndexPath for outlineView:child:ofItem:. This way I could use [outlineview rowAtPoint:point] (and similar) to get the NSIndexPath.

    This change required me to make a set of these indexPaths so they wouldn't get released until I don't need them. Also, all the other code which normally expected a model object now needs to lookup the model object from the index path. In my case this was efficient.

提交回复
热议问题