Cocoa Bindings in the face of a million of items in an NSArray

Posted by François Beausoleil on Stack Overflow See other posts from Stack Overflow or by François Beausoleil
Published on 2010-06-17T18:18:08Z Indexed on 2010/06/17 18:23 UTC
Read the original article Hit count: 219

Filed under:
|

I'm writing a GUI for MongoDB using Cocoa. It's going well, but I don't know how to make KVO properties that would be lazily loaded. How does one handle that?

For instance, viewing the documents in a Mongo collection. The collection might have a million items in it. I suspect I shouldn't be downloading the full 2-5 GiB of data to my Cocoa app, then format and display 20 rows. How does one implement that?

I called my project Mongo Explorer, available on GitHub. Specifically, how would I code MECollection#reload to be lazy? Do I need to implement a data source delegate for my NSTableView?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about cocoa-bindings