Example is provided below. If I set
id<RandomProtocol> delegate = [[B alloc] init];
Will doingSomething of class A or class B be called?
A.h
@protocol RandomProtocol
-(NSString*)doingSomething;
@end
@interface A : NSObject <RandomProtocol>
@end
A.m
#import "A.h"
@implementation A
- (NSString*) doingSomething {
return @"Hey buddy.";
}
@end
B.h
#import "A.h"
@interface B : A
@end
B.m
#import "B.h"
@implementation B
- (NSString*)doingSomething {
return @"Hey momma!";
}
@end