0
#import "Child.h"

NS_ASSUME_NONNULL_BEGIN

@interface Childson : Child
@property (nonatomic, class, copy) NSString *desc;
@property (nonatomic, class, assign) CGFloat height;
@property (nonatomic, assign) CGFloat weight;

- (void)childsonInfo;
+ (void)classchildsonInfo;
- (void)printAllInfo;

@end

NS_ASSUME_NONNULL_END

how can i get the list of class properties, eg: [desc, height]

the list of class_copyPropertyList/class_copyIvarList don't cotain the class property

the class property where they store, Class object? instance? MetaClass ?

Stone
  • 1
  • 2

1 Answers1

0
NSObject *obj = [[NSObject alloc] init];
Class cls = [obj class];
Class metaCls = object_getClass(cls);

unsigned int count;
objc_property_t *instancePropertyList = class_copyPropertyList(cls, &count);
objc_property_t *classPropertyList = class_copyPropertyList(metaCls, &count);

i know it now, thanks eveyone

Stone
  • 1
  • 2