How to know that we have reached the last line of NSTableView

NSTableView is what I use to display millions of data that I cannot receive in response due to a timeout.

So, I decided to get an answer on the pages, say 1-100, then 101-200, etc.

So, my problem starts here, how can I find out that I have reached the end of the View table or the cell is visible , says the 100th row?

I do not want to use the Load More.. button, etc.

After that I will post a new response with a new range.


Here is what I have tried so far:

Tried to track scrollView and get the next set of data on a service call.

* It works with the old mouse, but failed.

+4
source share
1 answer

Maybe you can determine the last visible row after scrolling, I have subclasses of NSTableView with this method.

 @interface MyTableView : NSTableView - (NSInteger)lastVisibleRow; @end @implementation MyTableView - (NSInteger)lastVisibleRow { NSRect bounds = [[self superview] bounds]; bounds.origin.y += bounds.size.height - 1; return [self rowAtPoint:bounds.origin]; } @end 
+4
source

Source: https://habr.com/ru/post/1487468/


All Articles