• 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
NSFileHandleReadCompletionNotification(s) not being posted when app is inactive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSFileHandleReadCompletionNotification(s) not being posted when app is inactive


  • Subject: NSFileHandleReadCompletionNotification(s) not being posted when app is inactive
  • From: John Clayton <email@hidden>
  • Date: Fri, 08 Apr 2005 18:19:50 -0400

Hello,

This is a reformulation of a previous post, but I have pinpointed the problems I am having to the subject above, so I thought I'd try again and see if anyone knows how to work around this.

Basically, I am using DO to communicate between two threads: a client, responsible for display, and a server that is following a log file. I initially tried to use NSFilehandle readInBackgroundAndNotify:] to tail the file and send the data back to the cilent. This works for a bit, then the NSFileHandleReadCompletionNotification's seem to stop coming in the server—until I deactivate the app and reactivate it—then bango! more notifications. Or, as soon as the app becomes inactive notifications stop instantly and restart when the app becomes active again.

I've been able to determine that [[NSRunLoop currentRunLoop] runMode] returns the string "null" when the app goes inactive.

I tried registering the notifications on different run loop modes using readInBackgroundAndNotifyForModes: but this has no effect. I can however use an NSInputStream. If I do this: [iStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; I can keep getting callbacks from the runLoop under all conditions. It's just inconvenient to re-implement seeking and keep alive in a custom stream subclass.

So, does anyone know how I can keep the NSFileHandleReadCompletionNotification's coming even when the app goes inactive, and get them not to stop or mysteriously after a few moments of working?

I do keep calling readInBackgroundAndNotifyForModes from my handler, BTW.

Thanks!

—John
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Sorting NSStrings in NSTableColumn (need 10 after 9)
  • Next by Date: Re: Ordered lists WAS ADC Core Data article
  • Previous by thread: Re: how to schedule NSLayoutManager
  • Next by thread: NSBezierPath line
  • Index(es):
    • Date
    • Thread