NSRunLoop vs. CFRunLoop
NSRunLoop vs. CFRunLoop
- Subject: NSRunLoop vs. CFRunLoop
- From: Ron Wagner <email@hidden>
- Date: Fri, 20 Jun 2003 15:01:58 -0400
I have two apps which I want to communicate with each other via
distributed objects. One of them is a straight cocoa app, the other is
implemented as a core foundation tool. I picked core foundation because
I am using IOKit to talk to a USB device and IOKit matches up well with
core foundation, as far as notifications and CFRunLoops goes.
In adding distributed objects to the tool, I am reading in the
Anguish/Buck/Yacktman book about DO, which gives a great little example
using NSRunLoop. I tried converting the core foundation tool to a
foundation tool using NSRunLoop and all works well except exiting the
runLoop. There seems to be no documented way to stop an NSRunLoop short
of removing all input sources. My old CFRunLoopStop() does not work
with an NSRunLoop. Is there any equivalent to CFRunLoopStop() for
NSRunLoops?
Next question is the part about [[NSRunLoop currentRunLoop]
configureAsServer]. From Apple's documentation, all that is said is:
- (void)configureAsServer
Performs all necessary configuration to make the receiver suitable for
use by a server process.
The Anguish/Buck/Yacktman book says that it tells the current run loop
not to terminate just because no input is pending. According to the
Apple docs, a run loop will not terminate until all input sources have
been removed. Does anyone know what configureAsServer really does, and
is it really needed for DO? I tried commenting it out and it ran fine,
so I'm wondering what I'll be missing if I leave it out, and what side
affects it will cause if I leave it in.
Can distributed objects be used with a CFRunLoop or am I flirting with
disaster? I tried the example project with a CFRunLoop and it *seemed*
to work, but again, I don't know if I am asking for trouble.
Thanks,
Ron Wagner
_______________________________________________
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.