title: UIDocumentInteractionController, No File Extension but UTI
body: <p>How do I send a file to a different App knowing which UTI the App supports? Lets say the file has no file extension, but I happen to know the UTI of the file.</p>
  
  <p>I tried the following:</p>
  
  <pre><code>// target is a NSURL with the location of the extension less file on the system
  // knownUTI is a NSString containing the UTI of the file 
      UIDocumentInteractionController* dic = [UIDocumentInteractionController interactionControllerWithURL:target];  
      [dic retain];
  
      dic.delegate = self;
      dic.UTI = knownUTI; 
      [dic presentOpenInMenuFromRect:CGRectZero inView:superController.view animated:YES]
  </code></pre>
  
  <p>It shows the supported App, however, if I select it, it won't switch the App. The delegate calls the </p>
  
  <pre><code>- (void)documentInteractionController:(UIDocumentInteractionController *)controller willBeginSendingToApplication:(NSString *)application
  </code></pre>
  
  <p>but </p>
  
  <pre><code>- (void)documentInteractionController:(UIDocumentInteractionController *)controller didEndSendingToApplication:(NSString *)application
  </code></pre>
  
  <p>is never called and the Application is never switching.</p>
  
  <p>The target App exports its UTI in the following:</p>
  
  <pre><code>    &lt;key&gt;CFBundleDocumentTypes&lt;/key&gt;
      &lt;array&gt;
          &lt;dict&gt;
              &lt;key&gt;CFBundleTypeIconFiles&lt;/key&gt;
              &lt;array/&gt;
              &lt;key&gt;CFBundleTypeName&lt;/key&gt;
              &lt;string&gt;Migration DocType&lt;/string&gt;
              &lt;key&gt;CFBundleTypeRol&lt;/key&gt;
              &lt;string&gt;Shell&lt;/string&gt;
              &lt;key&gt;LSHandlerRank&lt;/key&gt;
              &lt;string&gt;Owner&lt;/string&gt;
              &lt;key&gt;LSItemContentTypes&lt;/key&gt;
              &lt;array&gt;
                  &lt;string&gt;com.mycomp.customstring&lt;/string&gt;
              &lt;/array&gt;
          &lt;/dict&gt;
      &lt;/array&gt;
  
  ...
  
  &lt;key&gt;UTExportedTypeDeclarations&lt;/key&gt;
      &lt;array&gt;
          &lt;dict&gt;
              &lt;key&gt;UTTypeConformsTo&lt;/key&gt;
              &lt;array&gt;
                  &lt;string&gt;public.data&lt;/string&gt;
              &lt;/array&gt;
              &lt;key&gt;UTTypeDescription&lt;/key&gt;
              &lt;string&gt;My custom UTI&lt;/string&gt;
              &lt;key&gt;UTTypeIdentifier&lt;/key&gt;
              &lt;string&gt;com.mycomp.customstring&lt;/string&gt;
          &lt;/dict&gt;
      &lt;/array&gt;
  </code></pre>
  
  <p>As this did not work, I also tried adding a custom extension. Still, it would not work in this way. When adding the custom extension to the file I hand over to the <code>DocumentInteractionController</code> and it works. However, the list of applications shows all other applications supporting the same file extension regardless of the UTI type I supply.</p>
  
  <p>Say I declare 2 UTIs in 2 different applications:</p>
  
  <pre><code>App1 with UTI1: com.mycomp.a  with extension .abc
  App2 with UTI2: com.mycomp.b  with extension .abc
  </code></pre>
  
  <p>When handing the file to the DocumentInteractionController, and setting the UTI to <code>com.mycomp.a</code> it will also show App2 as a possible application being able to handle the file.</p>
  
  <p>I defined a UTI with extension in the following manner:</p>
  
  <pre><code>&lt;key&gt;UTExportedTypeDeclarations&lt;/key&gt;
      &lt;array&gt;
          &lt;dict&gt;
              &lt;key&gt;UTTypeConformsTo&lt;/key&gt;
              &lt;array&gt;
                  &lt;string&gt;public.data&lt;/string&gt;
              &lt;/array&gt;
              &lt;key&gt;UTTypeDescription&lt;/key&gt;
              &lt;string&gt;My UTI Type&lt;/string&gt;
              &lt;key&gt;UTTypeIdentifier&lt;/key&gt;
              &lt;string&gt;com.mycomp.a&lt;/string&gt;
              &lt;key&gt;UTTypeTagSpecification&lt;/key&gt;
              &lt;dict&gt;
                  &lt;key&gt;public.filename-extension&lt;/key&gt;
                  &lt;string&gt;abc&lt;/string&gt;
                  &lt;key&gt;public.mime-type&lt;/key&gt;
                  &lt;string&gt;application/abc&lt;/string&gt;
              &lt;/dict&gt;
          &lt;/dict&gt;
      &lt;/array&gt;
  </code></pre>
  
  <p>I would really appreciate your help, I'm kind of stuck.
  So, again the question: How do I send a file to an App with known UTI either without extension or having the same extension as other files of which I don't want to show the applications as choice in DocumentInteractionController?</p>
  
  <p>Thanks</p>