[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
NSNotificationCenter problem
From: |
Andreas Höschler |
Subject: |
NSNotificationCenter problem |
Date: |
Thu, 1 Nov 2007 11:15:19 +0100 |
Hi all,
I have a very weird problem that causes me tearing my hair out. For the
first time in my life something works beautifully well under GNUstep
but not at all under MacOSX. And I have no idea why. I do
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(storeDidRevert:)
name:SOInvalidatedAllObjectsInStoreNotification object:editingContext];
[[NSNotificationCenter defaultCenter]
postNotificationName:SOInvalidatedAllObjectsInStoreNotification
object:editingContext];
- (void)storeDidRevert:(NSNotification *)notification
{
NSLog(@"storeDidRevert...");
}
This works initially, but when I trigger
[[NSNotificationCenter defaultCenter]
postNotificationName:SOInvalidatedAllObjectsInStoreNotification
object:editingContext];
again, storeDidRevert: is not called anymore (only under MacOSX). My
first guess was there must be an removeObserver: statement anywhere,
but there is none. And I use exactly the same code on GNUstep where my
code works perfectly! :-(
Any idea how this can be tracked done efficiently (with gdb)? Under
GNUstep I would raise an exception in removeObserver if
notificationName is SOInvalidatedAllObjectsInStoreNotification but on
MacOSX I cannot simply alter and recompile the code of
NSNotificationCenter.
Hints are greatly appreciated!
Thanks,
Andreas
- NSNotificationCenter problem,
Andreas Höschler <=