Question

I have an application that currently accepts incoming files via UIDocumentInteractionController file types, but I'd also like to export a custom UTI to allow other applications to share only to my app if they prefer (as opposed to all apps that support incoming files of the same type). Basically I am trying to mimic what Instagram does (http://instagram.com/developer/iphone-hooks/).

While setting the UTI on the UIDocumentInteractionController does result in only my application being shown to the user, it also results in the following error. The error does not occur if the UIDocumentInteractionController UTI property is not set:

2013-07-15 10:56:02.476 Example[1117:907] Unable to link file://localhost/var/mobile/Applications/55C3F66E-725D-487C-B538-30139C685101/Example.app/photo.png 
to file://localhost/private/var/mobile/Applications/55C3F66E-725D-487C-B538-30139C685101/tmp/8C6C5225-6582-406C-83CD-BC5A92B91D09/photo.iracephoto. 
Error: The operation couldn’t be completed. (Cocoa error 513.)

Here is the UTI export in my Info.plist file:

<key>UTExportedTypeDeclarations</key>
<array>
    <dict>
        <key>UTTypeIdentifier</key>
        <string>me.irace.photo</string>
        <key>UTTypeTagSpecification</key>
        <dict>
            <key>public.filename-extension</key>
            <string>iracephoto</string>
        </dict>
    </dict>
</array>
Was it helpful?

Solution

I'm pretty sure the problem here is trying to share a photo from the resource bundle. Copying it to the Documents folder gets rid of the error message.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top