It’s not a problem, but i have noticed something in JuceNSView class.
notificationCenter is a member variable while NSNotificationCenter is singleton and object is same for whole application.
so why not…
It’s because of this dratted obj-c module cross-linking problem… If two modules contain the same named obj-c class and the wrong one gets invoked, it could end up using the singleton object from the wrong module… So doing it this way means that even if the wrong one is called, it should still be deregistering with the same pointer that it originally registered with. That’s the theory anyway…
Hopefully that should never happen if you’ve set up JUCE_ObjCExtraSuffix, but is there just in case.
[quote=“jules”]It’s because of this dratted obj-c module cross-linking problem… If two modules contain the same named obj-c class and the wrong one gets invoked, it could end up using the singleton object from the wrong module.
So doing it this way means that even if the wrong one is called, it should still be deregistering with the same pointer that it originally registered with. That’s the theory anyway…
Hopefully that should never happen if you’ve set up JUCE_ObjCExtraSuffix, but is there just in case.[/quote]
Could this happen, if two of my modules have different namespace ?
Interestingly the documentation for NSNotificationCenter says.
Doesn’t it mean that my entire application is going to have a single notification-center object or it means every module in my code would have a single notification-center object. Am a little confused with it.