简体   繁体   中英

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 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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM