V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
f1197199424
V2EX  ›  Swift

Swift 操作 plist 文件

  •  
  •   f1197199424 · 7 天前 · 491 次点击
    如题:有没有 swift 大佬告知一下,MacOS 业内开发如果需要操作 plist 一般用什么库啊?
    我有一定的开发经验 但是无 IOS 或者 MacOS 开发经验。
    我尝试使用 PropertyListSerialization 来操作,他是系统内置,不需要引入额外的开发包。但是带来的问题也就很麻烦。比如我通过命令行执行:
    ```
    /usr/libexec/PlistBuddy -c "Add :NowDays:1:Children:0:Checked dict" xx.plist
    ```
    就很方便,但是使用 PropertyListSerialization 就特别难受。

    所以请教下各位 IOS 或者 MacOS 大佬,有无类似的经验,给小弟一点启发或者参考。谢谢🙏。
    2 条回复    2025-02-05 19:44:09 +08:00
    darkengine
        1
    darkengine  
       7 天前
    Python 貌似可以,没试过哈,纯谷歌出来的:
    https://docs.python.org/3/library/plistlib.html
    iOCZS
        2
    iOCZS  
       7 天前
    配合 kvc 呢?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2549 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 15:37 · PVG 23:37 · LAX 07:37 · JFK 10:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.