readInBackgroundAndNotify not working?
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