问题
NSTableView
is what I am using to display millions of data, which I can not get in response due to time out.
So what I decided to get response in pages say 1-100 then 101-200 etc.
So my problem starts here, how can I know that I have reached to the end of tableView or the cell is visible say 100th row?
I dont want to implement Load More..
kind of button etc.
After this I will send a new response with new range.
Here is what I have tried so far:
Tried to track the scrollView and get next set of data by a service call.
*It works with old mouse but it failed with swipe.
回答1:
Maybe you can determine the last visible row after a scroll, I've a subclassed 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
来源:https://stackoverflow.com/questions/17235552/how-to-know-we-reached-the-last-row-of-nstableview