English 中文(简体)
缩略语4
原标题:Xcode 4 Document Types and Exported UTIs

I have an other problem with Xcode 4. I really like the new IDE but there are a few things I didn t get to work yet. One thing is to register Document Types with Xcode 4. I tried it with the old way through the plist file, but it didn t work. (Means I couldn t open a file with my app) But I don t now how to set it up with the interface of Xcode 4.

我最近尝试这样做:(把X条码输入胎儿。)

<key>UTExportedTypeDeclarations</key>
<array>
    <dict>
        <key>UTTypeConformsTo</key>
        <array>
            <string>public.plain-text</string>
        </array>
        <key>UTTypeDescription</key>
        <string>Configuration File</string>
        <key>UTTypeIdentifier</key>
        <string>com.myname.projec.iws</string>
    </dict>
</array>

并且

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeIconFiles</key>
        <array>
            <string>AnIcon-320</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>Config File</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>com.myname.projec.iws</string>
        </array>
    </dict>
</array>

这并不可行。 《邮报》的档案确实有选择,可以随同传阅。

是否有任何人以Xcode 4为工作榜样,或是怎样做的辅导。 我对如何开展工作没有任何进一步的想法。

Sandro

最佳回答

我认为作用和档案延期是缺失的。

如果你想说明档案的延期,你需要增加UTTypeTagSpecification:

    <key>UTExportedTypeDeclarations</key>

<array>

    <dict>
        <key>UTTypeConformsTo</key>
        <array>
            <string>public.text</string>
        </array>
        <key>UTTypeDescription</key>
        <string>my document type</string>
        <key>UTTypeIdentifier</key>
        <string>com.mycompany.myfiletypename</string>
        <key>UTTypeTagSpecification</key>
        <dict>
            <key>public.filename-extension</key>
            <array>
                <string>iws</string>
            </array>
        </dict>
    </dict>

为了发挥作用,你需要增加<> CFBundleTypeRole:

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>My file</string>
        <key>CFBundleTypeIconFiles</key>
        <array>
            <string>document-320.png</string>
            <string>document-64.png</string>
        </array>
        <key>LSHandlerRank</key>
        <string>Alternate</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>com.mycompany.myfiletypename</string>

        </array>
    </dict>
</array>
问题回答

您可以照相。 我的档案类型名称,为“文件类型” =>“项目0” =>“文件OS类型” =>“项目0”。

缺省值是“吗? 吗?” 你们可以改为“com.mycompany.myfile打字”。

我认为,其他财产本身也是这样。

我只看一看我的旧清单和剪辑,把钥匙和价值带入Xcode 4的新项目,该项目是从Xcode3版本进口的。 看来,在UTI s的候选名单中,有些胎儿“露面”。 然而,当我用Xcode3号表格把缺失的钥匙/价值重新贴在清单中时,这些新价值观在德国马克发挥了作用,并且出现在德国马克,这样你现在就可以“浏览”德国马克,看什么。 GUI公司倒置工程的金,但它运作。





相关问题
How to change out-of-focus text selection color in Xcode?

Okay, I ll bite. I ve got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, ...

Iphone NSTimer Issue

Hi I am new to objective c. I am trying to make an app for iphone. I have a button on my view, and the click on which the function playSound is called. This is working properly. It does plays the ...

Include a .txt file in a .h in C++?

I have a number of places where I need to re-use some template code. Many classes need these items In a .h could I do something like: #include <xxx.txt> and place all of this code in the ....

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Xcode open two editor windows with same file

Is it possible to open the same file in two separate windows in Xcode. I can open a file in one window and the same file in the main Xcode editor window, but I wanted two separate fulltime editor ...

Forcing code signing refresh in Xcode

In our environment, we share resources across multiple projects and platforms. When building for iPhone, only a subset of those resources are needed. Since that subset is still considerable, we have ...

热门标签