I have 4 classes (views):
A, B, C and D
Class A calls B, B calls C, and C Calls D:
A > B > C > D
In class D I have implemented a delegate protocol and I want to catch the delegate event in class A.
How can I achieve this?
There are multiple ways how you could achieve this. What's best in your case depends on the situation. Here are some ideas:
NSNotifications (not to be confused with NSUserNotifications in Mountain Lion). In your class A you post a notification to the default notification center and in class D you register to this notification and handle it as you want. Only use this approach though if nothing else works, because this can result in even worse code.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With