• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Run Loop in a Cocoa application?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Run Loop in a Cocoa application?


  • Subject: Run Loop in a Cocoa application?
  • From: Heiko Panther <email@hidden>
  • Date: Wed, 20 Nov 2002 17:56:13 +0100

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@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.

  • Follow-Ups:
    • Re: Run Loop in a Cocoa application?
      • From: Cameron Hayne <email@hidden>
  • Prev by Date: Re: Table View Blues (summary)
  • Next by Date: Re: Using IBInspectorManager's addInspectorModeWithIdentifier method
  • Previous by thread: Re: Setting the subclass for an NSTextView... in IB..
  • Next by thread: Re: Run Loop in a Cocoa application?
  • Index(es):
    • Date
    • Thread