Re: Network-based data source for NSOutlineViews
Re: Network-based data source for NSOutlineViews
- Subject: Re: Network-based data source for NSOutlineViews
- From: Chris Ridd <email@hidden>
- Date: Wed, 26 Nov 2003 07:58:18 +0000
On 25/11/03 11:03 pm, Frank Midgley <email@hidden> wrote:
>
On Nov 24, 2003, at 2:29PM, Chris Ridd wrote:
>
>
> However, I can't think of a good way of avoiding this synchronous
>
> behaviour.
>
> I won't necessarily know how many children a given entry has until I
>
> actually go and read them all, which takes some non-zero time.
>
> NSOutlineView
>
> wants to know the number of children immediately the parent is
>
> expanded.
>
>
One option is to display a "Fetching..." message while the query is
>
underway. Return a child count of 1 and return @"Fetching..." when
>
asked for the cell's value. Once the query completes you can fill in
>
your data source and reload that node in the tree.
That's a cleaner variant of my first idea, but it sounds like it will work.
I can wait for the result in another thread and send one of the reload
messages via performSelectorOnMainThread:withObject:waitUntilDone:modes:.
It will be interesting to see if I can send reload each time I get a result
back, and incrementally update the outline.
Thanks!
Chris
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.