lisonfan
V2EX  ›  C

[求助 OC] Xcode 的 Command Line Tool 项目如何用 API 取项目文件夹内的 plist 文件路径?

  •  
  •   lisonfan · Jul 12, 2015 · 1095 views
    This topic created in 3959 days ago, the information mentioned may be changed or developed.
    banxi1988
        1
    banxi1988  
       Jul 12, 2015
    1. 在 Build Phases 中的 Copy Files 添加一项。将你的 plist文件,添加进去。(如果已经有了跳过这一步)

    2. NSBundle.mainBundle().pathForResource("yourfilename", ofType: "plist")

    总结: 编译规则中添加将相应资源文件拷贝到最终打包的程序包中。
    然后使用 NSBundle相应的 API 来访问
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5939 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 75ms · UTC 02:14 · PVG 10:14 · LAX 19:14 · JFK 22:14
    ♥ Do have faith in what you're doing.