Re: NSInvocationOperations and background Threads
Re: NSInvocationOperations and background Threads
- Subject: Re: NSInvocationOperations and background Threads
- From: Nick Zitzmann <email@hidden>
- Date: Fri, 16 Oct 2009 10:48:04 -0600
On Oct 16, 2009, at 7:01 AM, John Love wrote:
I do not have a custom -start or a -main method, so I count on the
default -start and -main methods to handle the creation of a
background Thread for me.
You don't need them if you're using NSInvocationOperation. The
documentation was talking about those methods being defined in the
NSOperation subclass, and NSInvocationOperation just does the
invocation in its main method. And they don't create the thread;
NSOperation spins off the thread in different ways depending on your
OS and CPU architecture.
It appears however, that in my app there is no background Thread
that begins and the reason for that is because my app's window stays
in the background until all NSOperations are complete. Any clues?
Can you verify this in the debugger by breaking on the method being
invoked? I've never seen an NSInvocationOperation run in the same
thread in which it was added to a queue; in fact, this should not be
possible in Snow Leopard and later.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
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