Re: async NSOperation and NSOperationQueue
Re: async NSOperation and NSOperationQueue
- Subject: Re: async NSOperation and NSOperationQueue
- From: Benjamin Stiglitz <email@hidden>
- Date: Mon, 15 Sep 2008 12:05:35 -0400
Excerpts from John Love's message of Mon Sep 15 11:02:21 -0400 2008:
> I must be doing something terribly wrong, because when I start up the
> NSOperationQueue that does some time consuming calculations, I do not
> get back control of my application until after the lengthy calculation
> is complete. Here are the relevant code snippets:
At what point is your app sticking? After you start all the queues, but
before you return from -startCalculation?
> - (void) calculateWorksheetRow:(id)data {
> // takes a long time here
> }
>
>
> - (void) startQueue {
> theQueue = [[[NSOperationQueue alloc] init] autorelease];
> theOp = [[NSInvocationOperation alloc] initWithTarget:self
>
> selector:@selector(calculateWorksheetRow:)
> object:nil];
> [theQueue addOperation:theOp];
> }
You're starting one queue per operation, but you really want one queue
for all the operations.
-Ben
_______________________________________________
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