views:

272

answers:

1

I'm attempting to make use of the UIDocumentInteractionController mechanism in iPhone OS 3.2, but I'm struggling to figure out exactly how to construct a UTI that it likes.

I've gotten as far as attempting to set public.plain-text, but it's hard to test whether this is the correct UTI for a plain text document, since I can't tell whether the issue is that my iPad doesn't have any apps that support plain text import. (I figured Pages would, but I suppose perhaps not, since it will attempt and fail to load any files with the extension .pages, regardless of UTI).

Any seasoned OS X developers that can help on this?

+1  A: 

According to the Uniform Type Identifiers Reference, public.plain-text appears to be the correct UTI for plain text files.

If you want to see what UTIs an application responds to, you could grab its .ipa file (from the Mobile Applications directory in your iTunes library), rename it to a .zip file, extract the contents, and find the Info.plist within its application bundle. Within that property list should be a CFBundleDocumentTypes key, underneath which should be a list of UTIs handled by that application.

You could then test your UIDocumentInteractionController by specifying one of these known-good UTIs.

Brad Larson
Right on. I had trial-and-errrored my way to a similar solution before I decided to cut the feature. The documentation and feel of the feature when testing make it abundantly clear that it's purpose is to handle docs your app doesn't understand. I've got a feeling that an app would be rejected if it was used as merely a document export mechanism.
Justin Searls