Is there a way to get an array of class properties of certain kind? For example if i have interface like this
@interface MyClass : NSObject
@property (strong,nonatomic) UILabel *firstLabel;
@property (strong,nonatomic) UILabel *secondLabel;
@end
can i get the reference to those labels in implementation without knowing their name?
@implementation MyClass
-(NSArray*)getListOfAllLabels
{
?????
}
@end
I know i can do it easily with [NSArray arrayWithObjects:firstLabel,secondLabel,nil]
, but i would like to do it with some kind of class enumeration like for (UILabel* oneLabel in ???[self objects]???)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…