我看过很多关于添加到 plist 文件的教程,但我似乎无法正确地将嵌套标签插入到 plist 文件中。我想将以下行添加到我的 Info.plist 文件中
<key>AppTag</key> <array>
<string>hidden</string> </array>
NSMutableDictionary *plist = [[NSDictionary dictionaryWithContentsOfFile:@"/Users/me/Desktop/Info2.plist"] mutableCopy];
[plist setObject:@"AppTag" forKey:@"key"];
[plist setObject:@"hidden" forKey:@"string"];
[plist writeToFile:@"/Users/me/Desktop/Info2.plist" atomically:YES];
[plist release];