【问题标题】:How to generate strings file using ibtool?如何使用 ibtool 生成字符串文件?
【发布时间】:2016-03-24 13:22:39
【问题描述】:

我在 xcode 7.3 中安装了命令行工具,并在命令行中使用以下命令生成字符串文件:

  ibtool --generate-strings-file testFile.strings MyController.xib

我还尝试为我的 xib 提供目录路径:

  ibtool --generate-strings-file testFile.strings UI/Screens/My\ Card/MyController.xib

我还尝试了前面带有 sudo 的命令,来自 answer 的建议

它们都不起作用。

我得到了错误:

 <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.ibtool.errors</key>
    <array>
        <dict>
            <key>description</key>
            <string>Interface Builder could not open the document MyController.xib" because it does not exist.</string>
        </dict>
    </array>
</dict>
</plist>

【问题讨论】:

    标签: command-line-tool ibtool xcode7.3


    【解决方案1】:

    我使用了错误的 xib 位置。我通过在 xcode 的项目导航器中查看 xib 的层次结构来确定 xib 的位置。 BUt 正确的路径可以在 Source Control 选项下的 File Inspector 选项卡中找到。

    1. 选择xib文件

    2. 转到实用程序部分的文件检查器。

    3. 查看源代码管理选项下的位置路径。它将类似于:

        /Users/VenkataManiteja/Desktop/iOS/MyProject/src/MyController.xib
      

    我将命令更改为

       ibtool --generate-strings-file testFile.strings src/MyController.xib
    

    它成功了。

    【讨论】:

      猜你喜欢
      • 2012-07-21
      • 2018-12-13
      • 2015-04-03
      • 1970-01-01
      • 1970-01-01
      • 2022-08-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多