我很确定在 iOS 中不可能在主 Bundle 中写入......例如像这样的操作:
NSString *path = [[NSBundle mainBundle] pathForResource:@"Data" ofType:@"plist"];
.....something
[xmlData writeToFile:path atomically:YES];
Run Code Online (Sandbox Code Playgroud)
为什么Apple 文档中的第一个示例使用这个确切的代码?