On 27/7/11 3:18 AM, "Scott Ribe" <[email protected]> wrote:

> Maybe you should try to re-open your bug ;-)

I did, but no reply.

Here's some code that's reading a file that's being written periodically:

-(void)dataFromFile:(NSNotification *)notif {
    NSData *data = [[notif userInfo]
objectForKey:NSFileHandleNotificationDataItem];
    if ([data length]) {
     // do stuff
   }   
   [[notif object] readInBackgroundAndNotify]; // call again
}

In Snow Leopard that worked fine; a notification would be sent when new data
was written to the file. In Lion, as soon as it's called it goes into a
loop; each time readInBackgroundAndNotify is sent, a new notification comes
straight back.


-- 
Shane Stanley <[email protected]>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to