I want to create a secondary thread with its run loop running
(sleeping) until a performSelector is sent to it. Then it wakes up,
performs the selector, and go to sleep again. I imagine it to be
something like this:

- (void)threadMain:(id)data
{
    while(true)
    {
        [[NSRunLoop currentRunLoop] run];
    }
}

However, the -[NSRunLoop run] method exits immediately, because, in
accord with the the docs, there are no input sources or timers
attached to the run loop.

So I need to set up an input source, right?. The docs say input
sources can be port-based or custom *OR* just performSelector calls. I
am interested only in the performSelector calls.

So what should my code look like to set up such input source?

I have also read the "Defining a Custom Input Source" doc section, but
it seems too complicated and not really relevant to what I want to do.
I don't actually need the input source, I just want to send messages
from one thread to another. How do I do it?
_______________________________________________

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

This email sent to [EMAIL PROTECTED]

Reply via email to