पर आधारित कई क्रमांकित चर बनाएं I array की गणना का उपयोग करके NSDictionary
चर बनाने के लिए कैसे बनाएंगे?int
यह मूल रूप से मैं किसके साथ आया था, लेकिन मुझे यकीन नहीं है कि यह कार्य उद्देश्य-सी वाक्यविन्यास के साथ कैसे करें। 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;
}
क्या आप जो चाहते हैं उसे स्पष्ट कर सकते हैं? आप शब्दकोशों की एक सरणी बनाना चाहते हैं जिसमें प्रत्येक में केवल एक मान हो? – kubi