Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MulticastDelegate in ObjectiveC

I'm using MulticastDelegate class which is part of xmpp framework and taken here It works perfect for me! However I got warning:

'MulticastDelegate' may not respond to 'someMethod'

Is there any way to avoid the warning for this class? Thanks in advance.

like image 908
Dmytro Avatar asked Dec 30 '25 15:12

Dmytro


1 Answers

What kind of someMethod is that? Did you include the MulticastDelegate.h header?


Update: Aha, in that case you need to tell the compiler that the delegate implements the Notifier interface:

#import "MulticastDelegate.h"

@protocol Notifier
- (void) someMethod; 
@end

@interface Manager
{
   MulticastDelegate <Notifier> delegate;
}
@end

This should do. But isn’t the code a bit fishy? How do you know that the delegate implements someMethod when delegate is a plain MulticastDelegate? Are you omitting something in the example?

like image 84
zoul Avatar answered Jan 01 '26 16:01

zoul