![](/img/trans.png)
[英]NSOutlineView shows only first 2 levels of the NSTreeController hierarchy
[英]In a macOS Cocoa application, How to show only the first 'x' elements that match a NSPredicate in a NSOutlineView populated with a NSTreeController?
我正在开发一个macOS概念证明项目。 在主窗口中,我有一个通过Cocoa绑定和Core Data填充了NSTreeController的NSOutlineView。 在NSOutlineView下,我有一个搜索字段和一个“ Recents”按钮,就像项目导航器中的Xcode一样。 我的核心数据模型对象具有“ modifiedAt”属性,当用户选择“ Recents”按钮时,我只想在OutlineView中显示最后10个修改的文件。 关于如何实现这一目标的任何建议? 预先感谢您的任何帮助。
将fetchLimit
上的NSFetchRequest
设置为fetchLimit
的数字(在示例中为10)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.