Multiple notification calls?
Multiple notification calls?
- Subject: Multiple notification calls?
- From: Mark Dawson <email@hidden>
- Date: Thu, 9 Jun 2005 17:34:56 -0700
In one part of my code, I post a notification. However, the code that gets the notification gets called 3-4x. I'm not sure why. The code only goes through the notification routine once (doing a "continue" goes to the notification routine 4x, without going back to the code that posts the notification). I'm not sure how to debug this…I'm compiling on XCode 1.5, 10.3.9…
Thanks for any help!
mark
// setup of the notification
NSNotificationCenter *center = [NSNotificationCenter defaultCenter] ;
[center addObserver: self
selector: @selector(levelDidChangeNotification:)
name: defaultsDidChangeNotification_Level
object: nil];
...
// notification routine
- (void)levelDidChangeNotification:(NSNotification *)notification
{
#pragma unused (notification)
unsigned short newLevel = [mPopUpButton indexOfSelectedItem];
if (newLevel != [mLevels curLevel])
{
[mPopUpButton selectItemAtIndex:[mLevels curLevel]];
}
}
...
// code that sends the notification
[[NSNotificationCenter defaultCenter] postNotificationName: defaultsDidChangeNotification_Level
object:self];
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden