我有这个类:Iphone:如何获得一个类的所有属性?
@interface Mission : BaseModel
{
NSString *Description;
NSDate *EndDate;
NSMutableArray *MissionSectionList;
NSString *Name;
NSDate *StartDate;
}
@property (nonatomic, retain) NSString *Description;
@property (nonatomic, retain) NSDate *EndDate;
@property (nonatomic, retain) NSMutableArray *MissionSectionList;
@property (nonatomic, retain) NSString *Name;
@property (nonatomic, retain) NSDate *StartDate;
@end
是否有可能找出这个类的所有atrributes? 我
伊瓦尔class_getClassVariable(CLS级,为const char *名)试了一下
但我不知道这个名字应该是什么:
名称:名称的类变量定义来获取。
而实际上我想在不知道名字的情况下得到他们。
这可能吗?
如何使一个方法返回具有这些属性的数组?但它可能是一个不好的方法:) – Novarg 2012-01-09 10:09:03
什么信息的属性是你试图找到?它说你不想要这个名字,你想知道他们是什么类型? – ColdLogic 2012-01-09 10:33:14
我其实想要名称和类型。我不确定这个参数的名字是什么。因为我想找出名字。 – DeFlo 2012-01-09 11:49:21