Empty NSMetadataQuery results when trying to list iCloud folder contents

The flow I'm trying to achieve is "Make a selection of files and folders in a document browser. Copy the selected items into a folder."

The destination folder is static and resides in the application's Documents folder.

What I have now goes like this:

  1. Present UIDocumentBrowserViewController with allowsPickingMultipleItems.
  2. Have the user pick a file stored in iCloud.
  3. In didPickDocumentsAtURLs download the file. Works fine.
  4. Have the user pick a folder item in iCloud.
  5. List the folder contents with NSFileManager. This returns a nice set of NSURLs, but by design these can't be actually used to initiate a download.
  6. List the folder contents using an NSMetadataQuery. My observer gets notified of NSMetadataQueryDidFinishGatheringNotification, but the query results are empty. Search scopes and predicate of the query are:
[[self metadataQuery] setSearchScopes:[NSArray arrayWithObjects:NSMetadataQueryUbiquitousDocumentsScope, NSMetadataQueryAccessibleUbiquitousExternalDocumentsScope, url, nil]];
[[self metadataQuery] setPredicate:[NSPredicate predicateWithFormat:[NSString stringWithFormat:@"%%K like '*.*'"]]];

I'm expecting the query results to be a list of files currently present in the provided scopes. I've tried a number of variations for scopes and predicates, but the query's results is always empty.

Empty NSMetadataQuery results when trying to list iCloud folder contents
 
 
Q