NSNotificationCenter does the doc lie to us ??
NSNotificationCenter does the doc lie to us ??
- Subject: NSNotificationCenter does the doc lie to us ??
- From: Aurélien Hugelé <email@hidden>
- Date: Thu, 10 Mar 2005 14:42:21 +0100
Hi list !
Reading the documentation about NSNotificationCenter and notification posting, you can read this :
In a multithreaded application, notifications are always delivered in the thread in which the notification was posted, which may not be the same thread in which an observer registered itself.
the keyword here is **always**
i post a notification is the *main thread*, and its handler is executed in another thread :
2005-03-10 14:32:30.788 OD4MailPod Helper[2957] OD4MailPodHelperController: scanConnectedIpod: going to post "iPodDidConnect" Notification !
2005-03-10 14:32:30.788 OD4MailPod Helper[2957] OD4MailPodHelperController: scanConnectedIpod: current Thread = 0x00312AB0
2005-03-10 14:32:30.788 OD4MailPod Helper[2957] OD4MailPodHelperController: scanConnectedIpod: posted "iPodDidConnect" Notification !
2005-03-10 14:32:30.963 OD4MailPod Helper[2957] ODMPHAutonomousServer: iPodDidConnect: current Thread = 0x00342E70
as you can see the notification handler is not executed in the thread the notification was posted !?
can anybody explain me what happens ?
(Note that i don't want to know how to post in specific thread, but to know why do i not see what should be expected from the doc ;-) )
thanks
_______________________________________________
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