Re: Exposing a 'foreign' database through NSArrayController?
Re: Exposing a 'foreign' database through NSArrayController?
- Subject: Re: Exposing a 'foreign' database through NSArrayController?
- From: Mike Abdullah <email@hidden>
- Date: Sun, 10 Sep 2006 22:23:18 +0100
What I would do is create a Model object. Bind the tableview columns
to a normal array controller. Bind the array controller to this
model object like you would for any other app.
Then in your model, you basically need to implement:
-countOf<Key>
-objectIn<Key>AtIndex:
(and possibly) get<Key>:range:
-insertObject:in<Key>AtIndex:
-removeObjectFrom<Key>AtIndex:
(and possibly) replaceObjectIn<Key>AtIndex:withObject:
Implement these for each of the keys that make up your database and
NSArrayController should only call -objectIn<key>AtIndex: as it needs
it.
Mike.
On 10 Sep 2006, at 22:12, Stefan Arentz wrote:
I have a large database in a proprietary binary format that I would
like to show in a simple NSTableView. This is all read-only.
Is this is good use case for subclassing NSArrayController?
How would that work? Should I simply let arrangedObjects return my own
NSArray implementation that knows how to retrieve data from the
proprietary database and wrap it in a Objective-C class? I have
potentially hunderds of thousands of rows in this database so I would
prefer to implement some kind of lazy loading mechanism in my 'fake'
NSArray implementation.
Is this the right way to do it?
S.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden