• 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
readInBackgroundAndNotify not working?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

readInBackgroundAndNotify not working?


  • Subject: readInBackgroundAndNotify not working?
  • From: PCWiz <email@hidden>
  • Date: Sun, 23 Aug 2009 20:42:54 -0600

Hi,

I'm using this code to get a notification when a file has been updated:

- (void)startReading
{
NSString *logPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Logs/MyTestApp.log"];
NSFileHandle *fh = [NSFileHandle fileHandleForReadingAtPath:logPath];
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
[notificationCenter addObserver:self
selector:@selector(getData:)
name:@"NSFileHandleReadCompletionNotification"
object:fh];
[fh readInBackgroundAndNotify];
}


- (void) getData: (NSNotification *)aNotification
{
	NSLog(@"hai");
}

I know for sure that the file is being updated (MyTestApp.log), however the selector method (getData:) is never being called. Is there something I'm doing wrong?

Thanks
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: readInBackgroundAndNotify not working?
      • From: Kyle Sluder <email@hidden>
    • Re: readInBackgroundAndNotify not working?
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: I am not sure which message I have to trust?
  • Next by Date: Re: readInBackgroundAndNotify not working?
  • Previous by thread: Re: I am not sure which message I have to trust?
  • Next by thread: Re: readInBackgroundAndNotify not working?
  • Index(es):
    • Date
    • Thread