• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Exposing a 'foreign' database through NSArrayController?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Exposing a 'foreign' database through NSArrayController? (From: "Stefan Arentz" <email@hidden>)

  • Prev by Date: Exposing a 'foreign' database through NSArrayController?
  • Next by Date: Re: Releasing window controllers - at wits end
  • Previous by thread: Exposing a 'foreign' database through NSArrayController?
  • Next by thread: Re: Exposing a 'foreign' database through NSArrayController?
  • Index(es):
    • Date
    • Thread