• 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
Re: notification received twice
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: notification received twice


  • Subject: Re: notification received twice
  • From: PGM <email@hidden>
  • Date: Wed, 8 Feb 2006 17:51:41 -0500

Can it be that the controller is also the delegate of the window and is your method name the same as one of NSWindow's delegate methods? Then it will once perform the method as a delegate function, and once as a reaction to the notification. The solution then is simply not to subscribe to the notification. This was for my app the reason why my NSDocument subclass reacted twice to a WindowDidBecomeMain-notification.

PGM.


On 8 Feb, 2006, at 17:36, Ivan Kourtev wrote:

Hello,

I have a very simple app where a single window is created. After it is created, it measures a small amount of time and posts a notification that the app controller listens for. The app controller destroys the window , creates a new one and the whole process repeats.

The problem is the second time around, when the notification seems to be sent twice! I am fairly positive this is the case, even logged the events of sending and receiving the notification and that is exactly what the log shows - one sent notification, but two received!

What's going on here? I've take all the usual precautions -- including checking which object sends the notification? I searched and it seems some people had similar problems in the past (not fully resolved in these forums). Any helpful suggestion?

-- ivan

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden


This email sent to email@hidden


_______________________________________________ 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
References: 
 >notification received twice (From: Ivan Kourtev <email@hidden>)

  • Prev by Date: Re: Getting exact height of NSAttributedString
  • Next by Date: Re: notification received twice
  • Previous by thread: notification received twice
  • Next by thread: Re: notification received twice
  • Index(es):
    • Date
    • Thread