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.
Set the fetchLimit
on your NSFetchRequest
to be the number you want (10 in your example).