KVC

使用:

[fanye setValuesForKeysWithDictionary:dic];

如果出现关键字,则重写setter方法

@property (nonatomic,copy,setter=setDescription:)NSString *myDescription;

记得在.m文件加上

-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
    NSLog(@"UndefinedKey:%@",key);
}

原文地址:https://www.cnblogs.com/liaods/p/4788854.html