> You probably want to rethink what you mean by "processing of data".
> The table ALWAYS lazy loads, and only asks your data source for the
> row it needs when it needs them. The user scrolls, more rows needed,
> your data source supplies them.  This is all VIEW stuff, nothing to do
> with data processing. Your data model knows what it means by
> "finished", so it could arrange to let its controller know (e.g. using
> a notification of some sort) and the controller can hide the progress
> spinner. You probably want to keep the table out of it altogether.

Ok so, the way this is structured is, a UI button is clicked, and that
does two things:

1)  Tells the progress spinner to show itself and animate
2)  sends a 'parameterChanged' notification

Another part of the app listening for that event then begins processing
the audio, when it is complete, it sends a 'finished' notification along
with a pointer to the processed data.

The controller owning that NSTableView is then listening for that
event and it simply calls the reloadData tableview method.

The tableView is then populated, and the spinner is turned off...

The problem is, there is quite an obnoxious lag between spinner being
hidden and table view contents actually updating.  I am assuming because
this is a 13 column x several hundred rows, all consisting of
NSTextFields as their views...  And also strangely- which is most likely
the reason for this delay, when I followed the apple docs for setting up
a view based table (using their sample code as a starting point), I came
up with:


    NSTextField *result = [tableView 
makeViewWithIdentifier:kFrameDataTableViewIdentifier owner:self];
    if (!result) {
        result = [[NSTextField alloc] initWithFrame:NSZeroRect];
        result.font = [NSFont systemFontOfSize:8];
        result.bezeled = NO;
        result.backgroundColor = [NSColor clearColor];
        result.identifier  = kFrameDataTableViewIdentifier;
    }
    ...

And guess what?  result is always false...  Which makes me wonder why in their
documentation do they suggest that result == nil check?  But, I am confused why
it's recreating views from scratch anytime the table content changes?  That's
certainly going to most likely be the performance lag I am seeing.

But that's what my original question was regarding, if say that lag was not
nothing that could be removed, how could I make my progress bar hide not when
the table content updates, but when the table has completed it's updating
(hence the delay is over), because right now I get the spinner, it disappears,
but there is roughly a 0.75 second pause before the table data changes

Patrick J. Collins
http://collinatorstudios.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to