Runtime 1에서 대상의 모든 속성/방법 가져오기
#import@implementation NSObject (XXOOProperty)
/* */
- (NSDictionary *)getAllPropertiesAndVaules
{
NSMutableDictionary *props = [NSMutableDictionary dictionary];
unsigned int outCount, i;
objc_property_t *properties =class_copyPropertyList([self class], &outCount);
for (i = 0; i /* 객체의 모든 속성 가져오기*/
- (NSArray *)getAllProperties
{
u_int count;
objc_property_t *properties =class_copyPropertyList([self class], &count);
NSMutableArray *propertiesArray = [NSMutableArray arrayWithCapacity:count];
for (int i = 0; i < count ; i++)
{
const char* propertyName =property_getName(properties[i]);
[propertiesArray addObject: [NSString stringWithUTF8String: propertyName]];
}
free(properties);
return propertiesArray;
}
/* 객체를 가져오는 모든 방법*/
-(void)getAllMethods
{
unsigned int mothCout_f =0;
Method* mothList_f = class_copyMethodList([selfclass],&mothCout_f);
for(int i=0;i