Hi everyone,
I have a singleton object in my application (a ServerAccess class which represents functions/properties pertaining to my app server). This class uses a protocol (ServerAccessDelegate) for some communication.
If I do this:
server.sharedInstance.delegate = self;
It works fine, but it can only work with a single class. If I have two classes that are both subscribed to the ServerAccessDelegate, then only the most recent class to call delegate = self actually gets these delegate methods called, since it is a single 'delegate' variable.
Right now, I have solved this issue by simply using an array to store references to the ServerAccess delegates, and an addDelegate function so multiple classes can receive these delegate function calls. It works fine, but I was wondering does anyone know of a more elegant solution to this problem? My current solution feels very dirty.
Thanks!
- Brad