• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Multiple notification calls?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Multiple notification calls?
      • From: Chris Kane <email@hidden>
  • Prev by Date: Core Data and Regular Expressions
  • Next by Date: Re: Universal Binaries, x86 and compatibility...
  • Previous by thread: Core Data and Regular Expressions
  • Next by thread: Re: Multiple notification calls?
  • Index(es):
    • Date
    • Thread