I want to get property name by self.label1
, self.label2
, self.label3
etc.
Do you know how to convert NSString to some method like JS or Ruby.
my header is
@property(nonatomic,strong)CCLabelTTF *label1;
@property(nonatomic,strong)CCLabelTTf *label2;...
implementations
for (int i = 0; i < 10; ){
NSString *str = [NSString stringWithFormat:@"self.label%i",i];
// convert str to property
converted_str = [CCLabelTTF labelWithString:%@"hello below style is not good...
I want to avoid this style...
for(int i = 0 ;i < 10;){
if (i == 0){
self.label1 = ...
}else if(i == 1){
self.label = ...
}
Do you have any idea? Thanks in advance.