Skip navigation.
 
mlRun Loop in a Cocoa application?
FROM : Heiko Panther
DATE : Wed Nov 20 17:56:13 2002

Hi All,

I have a IB-built Obj-C Cocoa application. I want it to receive
MatchingNotifications from the IOKit. So I create a notificationPort,
and register its runLoopSource with the applications runLoop (acquired
with CFRunLoopGetCurrent()).

It's just that the notifications never come. If my IOService is there
when I issue the notification request, it is returned in the iterator.
If I add the IOService later, nothing happens.

I tried different things. I found out that the run loop is probably not
running after all; a call to

CFShow(CFRunLoopCopyCurrentMode(CFRunLoopGetCurrent()));

gives an output of (NULL), according to doc that means the loop is not
running.
So I tried to run it with

[[NSRunLoop currentRunLoop] run];

but that of course stopped the further execution of my code at that point.

Next I tried to create a separate thread in which I could run a run
loop; it didn't find my IOService either (not sure if that thread was
really running, but at least I did run it, and it did not stop execution).

So I'm pretty much out of ideas; any advice?

Thanks-
Heiko Panther
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlRun Loop in a Cocoa application? Heiko Panther Nov 20, 17:56
mlRe: Run Loop in a Cocoa application? Cameron Hayne Nov 20, 21:46