• 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: Tracking changes to NSTableView datasource
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tracking changes to NSTableView datasource


  • Subject: Re: Tracking changes to NSTableView datasource
  • From: Andre Masse <email@hidden>
  • Date: Sun, 02 Nov 2008 09:14:33 -0500

This is an very interesting idea. The only problem I can see is for undoing. I could begin a transaction before showing the view and commit or rollback accordingly. I need to explore the potentials problems of keeping a transaction open for a theoretically long time though. This to cover the cases where the user let the view open and takes a break or even leave for the night...

Thanks a lot Michael this could be a much simpler solution.

Andre Masse



On Nov 1, 2008, at 23:05, Michael Ash wrote:

I don't know if it's compatible with how you want things to work, but
an interesting feature of the NSTableViewDataSource protocol is that
you don't actually need an NSArray backing store at all. You can
instead just get and store data directly to whatever, well, stores
your data.

For example, if you have a directory listing in a table, then you
don't need to fetch the whole directory and store all the pertinent
information in an array. Instead you can just fetch the information
about the Nth file when the table queries it. This has some advantages
in simplicity, and also performance. The table is smart enough to only
ask for items that it actually needs in order to render, so for a
large data set it's only going to ask for the small fraction of items
that are visible. This means that the app doesn't have to pause while
building the directory listing.

In your case, you could hook the table directly up to the database,
bypassing the intermediate representation altogether. When the table
requests an item, query the database and return the data. When the
table updates a value, set the value in the database. As I said, I
don't know if this matches with how you want it to work, but if it
does then it could simplify what you're doing quite a bit.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Tracking changes to NSTableView datasource (From: "Michael Ash" <email@hidden>)

  • Prev by Date: Re: Need help to make this method prettier
  • Next by Date: Re: When and how often do you mix C++ with Objective C in your project?
  • Previous by thread: Re: Tracking changes to NSTableView datasource
  • Next by thread: Re: [MEET] CocoaHeads Mac Developer Meetings
  • Index(es):
    • Date
    • Thread