Re: storing, searching, and displaying variable-sized data sets
Re: storing, searching, and displaying variable-sized data sets
- Subject: Re: storing, searching, and displaying variable-sized data sets
- From: Steven Kramer <email@hidden>
- Date: Sat, 1 Jan 2005 20:46:09 +0100
Op 1-jan-05 om 8:42 heeft Matthew het volgende geschreven:
Thanks to everyone who had input on this issue. Here's a relevant
follow-up that involves populating a tableview with a lot of data once
you have it in memory:
Once you have the data loaded into your running application (let's
just assume it's an array), what might be the best way to have it
loaded via bindings into a tableview for search purposes?
Trying the straight forward approach of adding each item to the
NSArrayController individually with add: and calling rearrangeObjects:
is taking several minutes for an array size of ~15,000 where each row
is only 4 NSStrings. I'm not surprised by this really, but surely
there's a way to populate it much faster and I'd like to stick to a
filtered search (like Xcode's documentation for instance. Could
anyone comment on how that's implemented? Does dropping the bindings
and using delegates for the dataSource make that big of a difference?
In Xcode, as soon as I open help, the tableview populates almost
immediately and it's a pretty big table.
Using (datasource) delegates would definitely work. Using indexed
accessors for your array might work, I have no experience with that.
Also, reproducing the NSController / NSTableView magic using delegate
code is tedious but simple. And in the end will give you more
flexibility. So the answer depends partly on how far you want to take
the table UI.
In your current code you can probably already gain big speedups by
adding objects to an array (NOT the array controller) and then using
something like [arrayController setContent: my15KArray]. It will save
many unnecessary notification sending and handling.
Regards,
Steven Kramer
--
email@hidden
http://sprintteam.com/
_______________________________________________
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