이것은 답장입니다. 그러나 헤이, OP는 정확한 대답을 표시하지 않았다. 그래서 여기 나의 해결책이있다. 두 개의 속성 목록을 만들었습니다. 첫 번째는 상수, 문자열 및 부울과 같은 디버깅 정보입니다. 이 속성 목록은 SETTINGS.plist
입니다. 내 다른 plist는 내가 게임 데이터를 저장하는 데 사용하는 plist입니다. 설정 plist가 xcode 인터페이스를 통해 업데이트 된 것이므로 앱을 실행할 때마다 업데이트됩니다. 여기
-(void)setUpPlist{
listPath = [[self docsDir] stringByAppendingPathComponent:@"SETTINGS.plist"];
if (![[NSFileManager defaultManager] fileExistsAtPath:listPath]) {
[[NSFileManager defaultManager] copyItemAtPath:[[NSBundle mainBundle] pathForResource:@"SETTINGS" ofType:@"plist"] toPath:listPath error:nil];
}
else {
[[NSFileManager defaultManager] removeItemAtPath:listPath error:nil];
[[NSFileManager defaultManager] copyItemAtPath:[[NSBundle mainBundle] pathForResource:@"SETTINGS" ofType:@"plist"] toPath:listPath error:nil];
}
savedData = [NSMutableDictionary dictionaryWithContentsOfFile:listPath];
}
-(NSString *)docsDir{
return [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
}
는 listPath는 NSString
형이고 savedDate는 NSMutableDictionary
타입이다. 희망이 도움이됩니다.
디버그 환경에서 내 문제를 해결하고 다시 설치 ... thanks –