我的主应用程序包中有一个plist文件,我想通过我的应用程序进行更新。这是我正在使用的代码,问题是plist似乎没有更新。我的代码不正确还是还有其他问题?

// Data
NSMutableDictionary *data = [[NSMutableDictionary alloc] init];
[data setObject:self.someValue forKey:@"Root"];

// Save the logs
NSString *filepath = [[NSBundle mainBundle] pathForResource:@"MyFile" ofType:@"plist"];
[data writeToFile:filepath atomically:YES];

有人可以帮我吗?

最佳答案

IOS限制写入捆绑文件。如果需要可写的plist,则需要将其复制到应用程序的Documents文件夹中并在其中写入。

关于iphone - 如何覆盖plist文件的内容? (iPhone/iPad),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8954879/

10-09 01:33
查看更多