I would like to use NSArrayController to provide data in an NSTableView. The problem I am facing is that I do not want to preload all my data into an array, and then use the array controller methods setContent: My data model is a large existing code base that manages millions of records. It contains methods for efficiently returning a set of data rows.
Following the example that I found while limiting the number of objects in NSArrayController, I tried to subclass NSArrayController and override the arrangedObjects: method to return the proxy class of the array I wrote. The array proxy class provides the count: and objectAtIndex: methods. The object returned by objectAtIndex: is an NSDictionary. When I tried to return my proxy from the arrangedObjects: method, called both count: and objectAtIndex: but I also get an unrecognized selection error in my proxy class for the array for _valueForKeyPath:ofObjectAtIndex: It looked like a private method, so I did not continue to go that route.
I also thought about returning a smaller array of data from arrangedObjects: but could not figure out how I would determine which rows NSTableView was trying to display.
Is the data source the βrightβ way to interact with my existing data model, or is there some way to get NSArrayController working?
source share