@protocol msgRcvdFrom <NSObject>
@optional
-(void) msg:(NSString *)msg from:(NSString *)from;
.
.
.
if([delegate respondsToSelector:@selector(msg:from:)])
{
[delegate msg:body from:user];
}
this is my delegate and two different classes are using it, when respondsToSelector is called will both classes will be notified? or if I want to notify one class at a time. Please clear this confusion.
delegateusually is an object (declared asid< msgRcvdFrom>).So.. when you call
respondToSelectorondelegateyou are asking to that particular object if it has the method or not!