NSDictionary
配列のカウントを使用して多数の変数を作成するにはどうすればよいですか?
これは基本的に私が思いついたものですが、Objective-C 構文でこれを機能させる方法がわかりません。doesntContainAnother
ですNSArray
。の現在の値を使用する辞書の名前が必要ですloopInt
。
int *loopInt = 0;
while (doesntContainAnother.count <= loopInt) {
NSMutableDictionary *[NSString stringWithFormat:@"loopDictionary%i", loopInt] = [[[NSMutableDictionary alloc] init] autorelease];
[NSString stringWithFormat:@"loopDictionary%i", loopInt] = [NSDictionary dictionaryWithObject:[array1 objectAtIndex:loopInt]
forKey:[array2 objectAtIndex:loopInt]];
loopInt = loopInt + 1;
}