次のことを行う可能性があるかどうかを知りたいと思っていました。
私は次のような方法を持っています:
one = [[NSMutableArray alloc] initWithObjects:@"1",@"2",@"3", nil];
two = [[NSMutableArray alloc] initWithObjects:@"4",@"5",@"6", nil];
-(void)getStringAndChooseArray:(NSString *)nameOfArray {
//What i want to do is something like:
NSLog(@"The array %@ has got %i objects",nameOfArray,[nameOfArray count])
//Of course it is giving me an error since nameOfArray is a string..
//I know it is hard to understand,
//but what I'm trying to do is to call this method
//pass a string variable, which is named as one of the two arrays,
//and using it to do the rest..
}
文字列を使用して配列を識別し、操作する方法は?
前もって感謝します !