Xcode 4 Document Types and Exported UTIs
来源:互联网 发布:知柏地黄丸治疗性早熟 编辑:程序博客网 时间:2024/06/01 08:43
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.
My latest try looks like this: (Copied the entry made from Xcode in the info.plist)
我有一个关于Xcode4的其他问题。我真的很喜欢这个新的IDE,但也有几件让我无法工作的事情。其中一件事情是通过Xcode4注册文件类型。我试图通过老办法定义plist文件,但是它不能工作。(意味着我的应用程序不能打开一个文件),但是,我现在并不知道如何设置Xcode4的接口。
我的最新尝试看起来像这样:(复制在Info.plistXcode中的条目)
<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>
and:
<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>
This does not work. The file in Mail doesn't have the option to open with my app.
Does anyone have a working example with Xcode 4 or a tutorial how to do it. I don't have any further Idea how to get it work.
这是行不通的。邮件中附件没有打开我的应用程序的选项。
有谁有一个用于Xcode4工作良好的例子或怎么配置的教程。我是没有什么办法让它能正常工作了。
Sandro
3 Answers
I think the role and the file extension are missing.
If you want to specify a file extension, you need to add UTTypeTagSpecification:
我觉得缺少的了Role和文件扩展名。
如果你想指定一个文件扩展名,你需要添加UTTypeTagSpecification KEY:
<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>
For the role, you need to add CFBundleTypeRole:
关于Role,你需要添加CFBundleTypeRole KEY
<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>
- Xcode 4 Document Types and Exported UTIs
- XCode 3 to XCode 4 project types 区别
- Validating the Document Types in MIRO and MIR7 While Posting the Entry
- Reference Types and Values Types
- Generic types and Wildcard types
- Utis类
- Different types of sales document
- umbraco学习2:Document Types
- Primitive Types and Objects
- TCPL_4 types and declarations
- Types and Number Representation
- Python Types and Objects
- Stack Types and Instructions
- Python Types and Objects
- Integral Types and Values
- xcode模拟器document路径
- Primitive Types and Reference Types in Javascript
- Type Fundamentals (.NET: Primitive types, reference types and value types )
- Google App Engine: Another transaction by user xxx is already in progress for app yyy ...
- [JavaScript] 慎用window.event.cancelBubble
- Oracle 层次查询-学习笔记
- [架构]F1Engine v0.1 alpha使用说明
- UIColor:RGB和HSV互相转换
- Xcode 4 Document Types and Exported UTIs
- 多线程与fork
- WinISO5.3 注册码 不需要注册机
- Linux下线程池
- java WebService开发实例
- 1 bindService的启动 2通过AIDL来进行进程间的通信
- 通用MAKEfile模板
- {Android-OpenCV调用CvSmooth实现高斯模糊}
- [JavaScript] 解决window.open()打开同一个URL没能在两个网页中打开