• 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
Re: Getting disk mount notification with Foundation tools
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting disk mount notification with Foundation tools


  • Subject: Re: Getting disk mount notification with Foundation tools
  • From: Mike Vannorsdel <email@hidden>
  • Date: Sun, 09 Jun 2002 09:31:29 -0600

I do have a ready run loop for the notifications, but your answer reminded
me about something. Notifications seem to only arrive in the main run loop,
rather than the run loop where the observer was added. In my daemon, the
main loop is always busy doing work or sleeping while waiting on device I/O.
I had a different thread that was registered as the observer, which also
runs various timers. The workspace notifications were coming to the main
thread, which never had time to process them. I'll have to do some redesign
to get this working. Thanks.


On 6/8/02 1:53 PM, "Bill Bumgarner" <email@hidden> wrote:

> You need to have a running NSRunLoop to receive workspace notifications.
>
> The following output....
>
> 2002-06-08 15:49:01.584 notiftest[5277] -mountNotification: --
> NSConcreteNotification 80b40 {name = NSWorkspaceDidMountNotification;
> object = <NSWorkspace: 0x7b2b0>; userInfo = <CFDictionary 0x807b0
> [0x8016024c]>{count = 1, capacity = 1, pairs = (
> 2 : NSDevicePath = <CFString 0x6bdf0 [0x8016024c]>{contents =
> "/Volumes/foo"}
> )}}
> 2002-06-08 15:49:10.020 notiftest[5277] -unmountNotification: --
> NSConcreteNotification 7d7a0 {name = NSWorkspaceDidUnmountNotification;
> object = <NSWorkspace: 0x7b2b0>; userInfo = <CFDictionary 0x81ab0
> [0x8016024c]>{count = 1, capacity = 1, pairs = (
> 2 : NSDevicePath = <CFString 0x81bf0 [0x8016024c]>{contents =
> "/Volumes/foo"}
> )}}
>
> ... was generated by this code (the entire main.m for a Foundation tool
> that also links against the Cocoa framework)..
_______________________________________________
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.

References: 
 >Re: Getting disk mount notification with Foundation tools (From: Bill Bumgarner <email@hidden>)

  • Prev by Date: 2 Problems
  • Next by Date: Process Manager
  • Previous by thread: Re: Getting disk mount notification with Foundation tools
  • Next by thread: Re: Getting disk mount notification with Foundation tools
  • Index(es):
    • Date
    • Thread