Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I make NSMetadataQuery see my saved documents' folders as packages?
    primarykey
    data
    text
    <p>I'm writing an app which saves and loads documents both locally and on iCloud. Locally is working fine, but I'm having a problem with iCloud.</p> <p>The documents are saved as a package - the UIDocument reads and writes an NSFileWrapper which contains an image file, a thumbnail file, and an info plist. When I save the document to iCloud and then look at the files under 'Manage Storage', I see the individual files instead of the packages; and more importantly when I search for files using NSMetadataQuery it returns an NSMetadataItem for each of the individual files instead of the packages. As a result, my app doesn't realise there are any packages to load and iCloud is pretty useless.</p> <p>I <em>thought</em> that if I set up the document type and exported the UTI correctly that the packages would be treated properly. Was that right? If so, what's the checklist for setting up a document type as a package? I have:</p> <ul> <li>Added a document type</li> <li>set LSTypeIsPackage to YES (I've tried string YES and bool YES)</li> <li>set CFBundleTypeExtensions to an array containing one string: the file suffix</li> <li>set LSHandlerRank to Owner</li> <li>Exported a UTI with the same identifier</li> <li>set it to conform to com.apple.package</li> <li>added a UITypeTagSpecification dictionary, containing an array for the key public.filename-extension, which contains one string: the file suffix</li> </ul> <p>I've also tried adding a matching Imported UTI to match the exported one, but no luck there.</p> <p>What did I miss?</p> <p>UPDATE: I notice that the OP in <a href="https://stackoverflow.com/questions/9026242/nsmetadataquery-ignoring-custom-file-package-type">this question</a> is seeing the behaviour I want (even though he doesn't want it) so it must be possible.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload