나는이 plist의 이름이 level0, level1, level2 인 3 plist 파일을 가지며, 변수와 배열로 구성됩니다. 이 plist에서 데이터로 내 앱을 초기화합니다.plist에서 사전
+(instancetype)levelWithNum:(int)levelNum; {
NSString* fileName = [NSString stringWithFormat:@"level%i.plist", levelNum];
NSString* levelPath = [[[NSBundle mainBundle]resourcePath]stringByAppendingPathComponent:fileName];
NSDictionary *levelDic = [NSDictionary dictionaryWithContentsOfFile:levelPath];
NSAssert(levelDic, @"level no loaded");
Level *l = [[Level alloc]init];
l.coinsPerLvl = [levelDic[@"coinsPerLvl"] integerValue];
l.words = levelDic[@"words"];
return l;
}
이제 plist를 하나만 사용하여 3 개의 사전을 추가하기로 결정했습니다. plist 파일을 사용하는 위의 예제처럼 plist에서 하나의 사전 만 읽을 수 있습니까?
도움이 필요하시면 탱크를 이용하십시오! 당신은 단지 중간 변수 그게 필요
levels.plist의 문제가 무엇입니까? –