-(talkuser*)changeModle:(id)model
{
unsigned int count;
objc_property_t *properties=class_copyPropertyList([model class], &count);
talkuser *backModel=[[talkuser alloc]init];
for(int i =0; i < count; i++) {
objc_property_t property = properties[i];
//获取属性的名称C语言字符串
const char *cName =property_getName(property);
//转换为Objective C字符串
NSString *name = [NSString stringWithCString:cName encoding:NSUTF8StringEncoding];
id value= [model valueForKey:name];
[backModel setValue:value forKey:name];
}
free(propertys);
returnbackModel;
}
网友评论