How to use NSWindowDidExposeNotification
Posted
by Jeena
on Stack Overflow
See other posts from Stack Overflow
or by Jeena
Published on 2010-04-27T17:42:53Z
Indexed on
2010/04/27
17:43 UTC
Read the original article
Hit count: 177
Hi,
I am trying to update another windows when the one becomes visible. So I found the NSWindowDidExposeNotification and tried to work with it, so I wrote in my awakeFromNib:
// MyClass.m
- (void)awakeFromNib {
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc addObserver:self
selector:@selector(mentionsWindowDidExpose:)
name:NSWindowDidExposeNotification
object:nil];
}
and implemented the method
// MyClass.h
- (void)mentionsWindowDidExpose:(id)sender;
// MyClass.m
- (void)mentionsWindowDidExpose:(id)sender {
NSLog(@"test");
}
But it never gets called which is odd. What do I do wrong here?
© Stack Overflow or respective owner