我是ios的新手,我的应用程序中有一项要求是支持在其他应用程序(如dropbox)中请求时显示和打开文档类型,如doc,pdf。我阅读了Apple的文档,并说它在info.plist中添加了一行“文档类型”。但我不知道如果它是doc,pdf,我必须放在哪里。
我不确定这是否是我必须遵循的方法。
答案 0 :(得分:0)
将以下dict添加到info plist以打开文件类型,例如doc和pdf
------------- For PDF ----------------------
<?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>CFBundleTypeIconFiles</key>
<array>
<string>PDFIcon64.png</string>
<string>PDFIcon320.png</string>
</array>
<key>CFBundleTypeName</key>
<string>PDF</string>
<key>LSHandlerRank</key>
<string>Default</string>
<key>LSItemContentTypes</key>
<array>
<string>com.adobe.pdf</string>
</array>
</dict>
</plist>
-------对于DOC -----------
<?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>CFBundleTypeIconFiles</key>
<array>
<string>PDFIcon64.png</string>
<string>PDFIcon320.png</string>
</array>
<key>CFBundleTypeName</key>
<string>DOC</string>
<key>LSHandlerRank</key>
<string>Default</string>
<key>LSItemContentTypes</key>
<array>
<string>com.microsoft.word.doc</string>
<string>org.openxmlformats.wordprocessingml.document</string>
<string>org.openxmlformats.wordprocessingml.document.macroenabled</string>
</array>
</dict>
</plist>