有人可以举例说明如何使用NSCache缓存字符串吗?或者任何人都有一个很好的解释链接?我似乎无法找到任何..
我有一个NSTableView,我想知道用户何时滚动到底部,所以我可以执行一个动作.不太清楚如何去做?
更新:这是我如何计算表格的底部:
-(void)tableViewDidScroll:(CPNotification) notification
{
var scrollView = [notification object];
var currentPosition = CGRectGetMaxY([scrollView visibleRect]);
var tableViewHeight = [messagesTableView bounds].size.height - 100;
//console.log("TableView Height: " + tableViewHeight);
//console.log("Current Position: " + currentPosition);
if (currentPosition > tableViewHeight - 100)
{
console.log("we're at the bottom!");
}
}
Run Code Online (Sandbox Code Playgroud)