Animal类
- #import <Foundation/Foundation.h>
- @interface Animal : NSObject
- @property(nonatomic,assign) double weight;
- @end
复制代码
Person类
- #import "Animal.h"
- #import "DogDelegate.h"
- @interface Person : Animal<DogDelegate>
- @property(nonatomic,copy) NSString *name;
- @end
- #import "Person.h"
- @implementation Person
- -(void)cureDog{
- NSLog(@"狗狗在%@的精心照顾下好了",_name);
- }
- @end
复制代码
|