0

我在 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 的命令,从这个答案中建议

他们都没有工作。

我得到了错误:

 <?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>
4

1 回答 1

0

我使用了错误的 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

它奏效了。

于 2016-03-24T13:37:25.880 回答