以编程方式在 plist 文件中添加键值对,保留文件的现有顺序
有什么方法可以将新的键值对添加到现有的 plist 文件中。我还想保留现有文件中键和值的顺序。如果处理dictionaries.plist 文件存储在磁盘上,除了根 NSDictionary 之外,所有键和值都是“String”类型。
Is there any way by which I can add the new key-value pairs to an existing plist file.I also wants to preserve the order of the keys and values in the existing file.I am facing problem in preserving the order if dealing with the plist in dictionaries.Plist file is stored on the disk and all the keys and values are of type "String" except the root which is NSDictionary.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为此,您需要编写自己的 plist 解析器和生成器。为了获得充分的灵活性,您需要从头开始编写它,而不依赖于 XML 解析器,或者至少不依赖于通用解析器。
To do this, you will need to write your own plist parser and generator. For full flexibility, you’ll need to write it from scratch, not relying on an XML parser, or at least not a general-purpose one.