How can you get indexes of visible rows for an NSOutlineView?
问题 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 NSOutlineView equivalent to CocoaTouch/UITableView - (NSArray *)indexPathsForVisibleRows 回答1: you can do the following: NSScrollView* scrollView = [self.tableView enclosingScrollView]; CGRect visibleRect = scrollView.contentView.visibleRect; NSRange range = [self.tableView rowsInRect:visibleRect]; in the range you will get the