使您能够在Objective C分类中添加属性成为可能
查看http://stackoverflow.com/questions/8733104/objective-c-property-instance-variable-in-category
没有特别之处。只需在@interface中正常添加属性,并在@implementation中使用@dynamic即可。
YourClass.h
@interface YourClass (YourCategory)
@property NSString *yourProperty;
@end
YourClass.m
@implementation YourClass (YourCategory)
@dynamic yourProperty;
@end
DProperty是在MIT许可证下发布的。