V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
f1197199424
V2EX  ›  Swift

Swift 操作 plist 文件

  •  
  •   f1197199424 · Feb 5, 2025 · 3549 views
    This topic created in 457 days ago, the information mentioned may be changed or developed.
    如题:有没有 swift 大佬告知一下,MacOS 业内开发如果需要操作 plist 一般用什么库啊?
    我有一定的开发经验 但是无 IOS 或者 MacOS 开发经验。
    我尝试使用 PropertyListSerialization 来操作,他是系统内置,不需要引入额外的开发包。但是带来的问题也就很麻烦。比如我通过命令行执行:
    ```
    /usr/libexec/PlistBuddy -c "Add :NowDays:1:Children:0:Checked dict" xx.plist
    ```
    就很方便,但是使用 PropertyListSerialization 就特别难受。

    所以请教下各位 IOS 或者 MacOS 大佬,有无类似的经验,给小弟一点启发或者参考。谢谢🙏。
    2 replies    2025-02-05 19:44:09 +08:00
    darkengine
        1
    darkengine  
       Feb 5, 2025
    Python 貌似可以,没试过哈,纯谷歌出来的:
    https://docs.python.org/3/library/plistlib.html
    iOCZS
        2
    iOCZS  
       Feb 5, 2025
    配合 kvc 呢?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3304 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 12:54 · PVG 20:54 · LAX 05:54 · JFK 08:54
    ♥ Do have faith in what you're doing.