获取类中所有属性


    u_int               count;

    objc_property_t*    properties= class_copyPropertyList([person class], &count);

    for (int i = 0; i < count ; i++)

    {

        const char* propertyName = property_getName(properties[i]);

        NSString *strName = [NSString  stringWithCString:propertyName encoding:NSUTF8StringEncoding];

        NSLog(@"%@",strName);

    }

iOS