I am using NSNotificationCenter object. I need to know all the listeners and the events they listen to. Is there anything that I can do to get this listing?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Nope; why do you need to know?
The whole goal of notifications is to create a loosely couple system of observers vs. notifiers. The very question of “knowing all” doesn’t make sense as it is perfectly possible that there will be observers of the notification that come from code you didn’t author at all (assuming a system notification).
And, of course, if it is a notification that you create that is named uniquely to your app, then you should also know all possible observers.