开发者

Cocoa and executable files

Hey, I am writing a Cocoa app for Mac OS X and I want it to be able to open executable files. That is, files with the 'e开发者_如何转开发xecute' permission. These files usually do not have a file extension, so I don't know how to specify this in the plist file.

How can I make the Open panel allow the user to select UNIX executables? Thanks in advance.


Note that I don't want to execute them.


To have your application listed in the "Open With..." panel of the Finder for unix -executable file, you have to update your Info.plist for CFBundleDocumentTypes with the following:

<dict>
    <key>CFBundleTypeRole</key>
    <string>Editor</string>
    <key>LSItemContentTypes</key>
    <array>
        <string>public.unix-executable</string>
    </array>
</dict>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜