一、例如,我有一个StudyProtocol协议,学习协议,我还有一个Student类,这个类遵守了StudyProtocol协议
1.StudyProtocol.h文件如下:
#import
@protocol StudyProtocol < NSObject >
- (void)study;
- (void)qiaoCode;
@end
Student.h文件中:
#import
#import “StudyProtocol.h”
@interface Student : NSObject < StudyProtocol >
@end
Student.m文件中: