Objective-C Protocol Forward Declarations

前端 未结 4 1988
心在旅途
心在旅途 2020-12-03 00:31

ObjectProperties.h

@protocol ObjectProperties 

@property (strong, nonatomic) NSString *name;
@property (strong, nonatomic) NSDate *         


        
4条回答
  •  Happy的楠姐
    2020-12-03 00:49

    By declaring your class in MyClass.h, you have to import all header files for its superclass as well as protocols it adopted in the MyClass.h file. Protocols in Objective-c is considered as a variant type of inheritance.

    Forward declarations are usually used in class' member declaration .

提交回复
热议问题