Files
wehub-resource-sync d88fd01084
CI / test (3.10) (push) Failing after 1s
CI / test (3.12) (push) Failing after 0s
CI / skillgen-check (push) Failing after 0s
CI / security-scan (push) Failing after 0s
chore: import upstream snapshot with attribution
2026-07-13 12:09:14 +08:00

55 lines
711 B
Objective-C

#import <Foundation/Foundation.h>
#import "SampleDelegate.h"
@interface Animal : NSObject <SampleDelegate>
@property (nonatomic, strong) NSString *name;
- (instancetype)initWithName:(NSString *)name;
- (void)speak;
@end
@implementation Animal
- (instancetype)initWithName:(NSString *)name {
self = [super init];
if (self) {
_name = name;
}
return self;
}
- (void)speak {
NSLog(@"%@ makes a sound.", self.name);
}
@end
@interface Dog : Animal
- (void)fetch;
@end
@implementation Dog
- (void)fetch {
[self speak];
NSLog(@"%@ fetches the ball!", self.name);
}
@end
@protocol Base
- (void)baseMethod;
@end
@protocol Derived <Base>
- (void)derivedMethod;
@end