0
私はそれをどのように行うのです文字列/数字を文字列に追加するにはどうすればよいですか?
objectForKey:@"level + STRING/NUMBER"
-(void) generateLevelFromPlist:(int)currentLevel{
NSString *mainPath = [[NSBundle mainBundle] bundlePath];
itemPositionPlistLocation = [mainPath stringByAppendingPathComponent:@"levelconfig.plist"];
NSDictionary * itemPositions = [[NSDictionary alloc] initWithContentsOfFile:itemPositionPlistLocation];
NSNumber *xVal = [[[[itemPositions objectForKey:@"level + STRING/NUMBER"]objectForKey:@"hexposition"]objectForKey:@"hexagon1"]objectForKey:@"xVal"];
int generatedXVal = [xVal integerValue];
NSLog(@"%d", generatedXVal);
NSLog(@"%@", itemPositionPlistLocation);
}
がありますか?
恐ろしいです!あなたにすっごくありがとう!ちなみに、私が実際に望んでいたのは、 'myString = [NSString stringWithFormat:@"レベル%d "、currentLevel]'がなくても... :) –