On the subject of associating your iPhone app with file types.
In this informative question I learned that apps could be associated with custom URL protocols.
In addition to Brad's excellent answer, I have found out that (on iOS 4.2.1 at least) when opening custom files from the Mail app, your app is not fired or notified if the attachment has been opened before. The "open with…" popup appears, but just does nothing.
This seems to be fixed by (re)moving the file from the Inbox directory. A safe approach seems to be to both (re)move the file as it is opened (in -(BOOL)application:openURL:sourceApplication:annotation:
) as well as going through the Documents/Inbox directory, removing all items, e.g. in applicationDidBecomeActive:
. That last catch-all may be needed to get the app in a clean state again, in case a previous import causes a crash or is interrupted.