I am developing a macOS proof of concept project. I have, in the main window, a NSOutlineView populated with a NSTreeController via Cocoa bindings and Core Data. Under the NSOutlineView, I have a search field and a "Recents" button, a bit like Xcode has in the project navigator. My Core Data model object has a "modifiedAt" property and, when the user selects the "Recents" button, I would like to show only the last 10 modified files in the OutlineView. Any suggestions on how to achieve that ? Thank you in advance for any help.
将fetchLimit
上的NSFetchRequest
设置为fetchLimit
的数字(在示例中为10)。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.