Re: OmniNetworking and communicating with the main thread
Re: OmniNetworking and communicating with the main thread
- Subject: Re: OmniNetworking and communicating with the main thread
- From: Nick Zitzmann <email@hidden>
- Date: Mon, 26 May 2003 19:20:32 -0700
On Monday, May 26, 2003, at 05:20 PM, Phil Larson wrote:
I searched through mamasam and learned that the OmniNetworking
framework is meant to be used in a blocking thread. Then the thread
communicates with the main thread when something interesting happens.
However, I couldn't find anything about communicating with the main
thread from the networking thread. I know that notifications are sent
in the thread of the poster, so that wouldn't work.
What is the best way to communicate from a "helper" thread to the main
thread in a Cocoa application?
I can think of three ways of doing this, so take your pick:
1. NSObject's -performSelectorOnMainThread:withObject:waitUntilDone:
methods (only works in OS X 10.2 or later)
2. OmniFoundation's -mainThreadPerformSelector methods
3. Use NDRunLoopMessenger[1] to send the message to the run loop (which
is in the main thread)
Nick Zitzmann
AIM/iChat: dragonsdontsleep
Check out my software page:
http://dreamless.home.attbi.com/
"Great spirits have always encountered violent opposition from mediocre
minds." - Albert Einstein
[1]
<
http://homepage.mac.com/nathan_day/pages/
source.html#NDRunLoopMessenger>
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.