#import <objc/runtime.h>
typedef NS_ENUM(NSUInteger, PropertyArrayType) {
PropertyArrayTypeName,
PropertyArrayTypeAttribute
};
+ (NSMutableArray *)arrayWithModel:(id)model
type:(PropertyArrayType)type{
Class clazz = [model class];
u_int count;
objc_property_t* properties = class_copyPropertyList(clazz, &count);
NSMutableArray* propertyArray = [NSMutableArray arrayWithCapacity:count];
NSMutableArray* attributeArray = [NSMutableArray arrayWithCapacity:count];
for (int i = 0; i < count ; i++)
{
objc_property_t prop= properties[i];
const char* propertyName = property_getName(prop);
const char* attributeName = property_getAttributes(prop);
[attributeArray addObject:[NSString stringWithCString:attributeName encoding:NSUT