GUI threading question
GUI threading question
- Subject: GUI threading question
- From: email@hidden
- Date: Mon, 2 Feb 2009 10:49:11 -0500 (EST)
- Importance: Normal
It has long been my understanding that in order to keep a GUI from
freezing in Cocoa during LONG methods you have to create a
NSOperationQueue and load the method as a NSInvocationOperation as seen
here:
- (IBAction)launchBigTask:(id)sender
{
NSInvocationOperation* theOp = [[NSInvocationOperation alloc]
initWithTarget:self selector:@selector(myBigMethod:) object:nil];
[myOpQueue addOperation:theOp];
}
-----------------
I was looking at another developers (Drew
McCormick)(http://www.macresearch.org/node/4567) code recently in a
scientific multi-processing example, and he seems to achieve the same GUI
independence without launching a NSInvocationOperation?
-----------------Why doesn't his GUI lock?
If I could duplicate this it would allow me to us NSOperationQueue to
multi-process a critical loop in my code, and then issue the
waitUntilAllOperationsAreFinished to wait for those ops to finish before
loading a shared array with new data and running loop again .
Is there another way to keep GUI active?
Thankyou,
Ron Jurincie
_______________________________________________
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