Multiple Delegates in Objective C

Viewed 12766

I'm coming from the C# event model, and I'm wondering if there is a standard way to notify multiple delegates of an event?

I have a ClassCDelegate protocol that I want both ClassA and ClassB to implement. Is there a way I can assign an instance of ClassC both ClassA and ClassB as delegates without having to manually create a list of delegate variables within ClassC and iterate through them?

6 Answers

It's also important to note that Notifications are a one-way street - They cannot send information back, as delegates can. The only case where you'd want to iterate through a list of delegates is if your delegating class expects back information from its delegates.

Related