我做了这个方法
-(NSMutableArray *)getProperties:(id)c
{
NSString *propertyName;
unsigned int outCount, i;
NSMutableArray *propertieNames = [[NSMutableArray alloc] initWithObjects: nil];
objc_property_t *properties = class_copyPropertyList(c, &outCount);
for (i = 0; i < outCount; i++) {
objc_property_t property = properties[i];
propertyName = [NSString stringWithUTF8String:property_getName(property)];
[propertieNames addObject:propertyName];
}
return propertieNames;
}
我用这个
NSMutableArray *propertiesNames = [self getProperties:[self class]];
我想用这个
NSMutableArray *propertiesNames = [[self class] getProperties];
如何将类别添加到 Class 类。也许 Class 类不是 Object....
我尝试将类别添加到类
#import "Class+SN.h"
@implementation Class (SN)
@end
我有错误
Cannot find interface declaration for 'Class'