For example I've got class:
比如我上课了:
@interface CustomClass: NSObject
@property(nonatomic, readwrite) NSString *name;
@property(nonatomic, readwrite) NSNumber *value;
-(NSDictionary *)getDict;
@end
@implementation CustomClass
-(NSDictionary)getDict
{
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary: @{}];
if(self.name) {
dict[@"name"] = self.name;
}
if(self.value) {
dict[@"value"] = self.value;
}
return dict;
}
@end
@interf