开发者

In iPhone OS, what UTI represents a plain ol' text file?

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 cor开发者_运维知识库rect 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?


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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜