How to set Document Types in XCode 4.2?
Asked Answered
A

3

5

I have an iPhone app, and I would like it so that when a user clicks on a .pdf file as an email attachment, my App is one of the options to open it with. After some research, it seems that I need to add a Document Type in the info.plist. Problem is, I cannot find ANY tutorials explaining how to use the new Document Type GUI:

Image here:

Screenshot

Can anybody help me?

Antifreeze answered 1/11, 2011 at 22:32 Comment(1)
While it doesn't cover this particular graphical way of setting document types in Xcode's UI, my answer to the question How do I associate file types with an iPhone application? shows how to do this programmatically.Loma
B
7

This "Document Types" editor feature may be so new (was it introduced in 4.2) that the documentation sloths haven't had time to write anything about it.

I did find this Technical Q&A document that describes "How do I get my application to show up in the 'Open in...' menu on iOS for a specific document type?", which basically introduces the Xcode developer to the Document Types editor.

And more low level documentation.

If you understand these basics and can figure out how to edit a raw Info.plist file, you should be good to go!

I hope this information helps you out.

Bitter answered 1/11, 2011 at 23:35 Comment(1)
Thanks for letting me know @trojanfoe. hopefully I've corrected my link to be a lot more useful.Bitter
C
6

It looks like there's still no official documentation on this. With the help of this SO answer describing how to write the info.plist file, I came up with this in Xcode 4.5.1:

enter image description here

This set of properties seems to be the minimum to get your app to run by tapping on an email attachment.

Cookson answered 23/10, 2012 at 20:39 Comment(0)
L
4

It should be sufficient to set the "Name" field to "Portable Document Format" and the types field to "com.adobe.pdf".

Logsdon answered 3/11, 2011 at 21:20 Comment(1)
This worked for me on Xcode 4.5.1 with the exact strings you gave.Cookson

© 2022 - 2024 — McMap. All rights reserved.