通过objective-c的反射,写了获取类的属性的方法。
-(void) getPropertyList
{
unsigned int nCount = 0;
objc_objectptr_t *popertylist = class_copyPropertyList([UIButton class],&nCount);
for (int i = 0; i < nCount; i++)
{
objc_objectptr_t property = popertylist[i];
NSLog(@"class Name is = %s && attr = %s",property_getName(property), property_getAttributes(property));
}
}