Hey, right now I have implemented my own listener pattern. I will send an update to the listeners using fast enumeration. the code will look like this
- (void) updateListeners {
for (id<AProtocol>listener in _listeners)
{
[listener update];
}
and in listener, i implement method for AProtocol, which is update. suppose there are n object in _listeners, and m number of listener such that m < n want to remove it self from listen when listener's update method is called. The problem with this is that I can't remove when the fast enumeration is ongoing, I will get an error. In order to make the listener more dynamic so that we can remove listener from _listeners when update method is called, what would be the solution?( I don't want to use NSNotificationCenter)