我想知道是否有任何可能做到以下几点:麻烦简单的阵列 - 可可
我有这样的方法:
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..
}
如何使用字符串标识数组并操纵它?
在此先感谢!
我真的怀疑你想这样做的原因。 – Almo
因为我的应用程序,我简化了课程当然.. 我正在使用表和SQL数据,但因为这是我第一次有很多麻烦... 基本上我有一个表与许多SQL表中的字段,并需要相对阵列选择点击的表.. 相当困难的都为我和我的英文不好.. 感谢解释反正 –
你的英语没有那么糟糕。 :)感谢您的背景。 – Almo