I have a class that send delegate messages to another class. If the other class is not listening, the app is crash . I was looking for a way to check if the other class is listen before i send the message.
so in the class that post the delegate , i have this condition the check that :
if ([self.delegate respondsToSelector:@selector(NewDataFromSocketWithString:WithCommand:)])
[self.delegate NewDataFromSocketWithString:final WithCommand:c];
Where somehow , the condition is always true, even if the class that gets the delegate is already released and not exist anymore .
How do i check the delegate before posting to eliminate crashes ?