- (NSArray *)allPropertyNames:(Class)aClass
{
unsignedcount;
objc_property_t *properties = class_copyPropertyList(aClass, &count);
NSMutableArray *rv = [NSMutableArray array];
unsignedi;
for(i =0; i < count; i++)
{
objc_property_t property = properties[i];
NSString *name = [NSString stringWithUTF8String:property_getName(property)];
[rv addObject:name];
}
free(properties);
returnrv;
}
网友评论