NSNotification on multiple objects
Posted
by Jan Hendrix
on Stack Overflow
See other posts from Stack Overflow
or by Jan Hendrix
Published on 2010-04-17T20:03:01Z
Indexed on
2010/04/17
20:13 UTC
Read the original article
Hit count: 330
nsnotifications
|cocoa
Hi,
In my NSApp delegate I add an observer of an object that is an NSWindow subclass that gets initiated in the delegate itself and that posts a notification once the window gets clicked. The selector is also in the delegate. From that same delegate class I initiate another object which when initiated adds itself as an observer for another window of the same NSWindow subclass of above and the selector is in this newly initiated class too. Both notifications get posted but the problem is that they get posted in both classes... Is this normal? I was hoping that it only got posted once.
© Stack Overflow or respective owner