Skip to content

Commit

Permalink
Merge pull request #27 from bgfriend0/ExtensionlessFilenames
Browse files Browse the repository at this point in the history
Update NSMetadataQuery's predicate to support matching extensionless filenames
  • Loading branch information
Sam Spencer committed Jan 25, 2014
2 parents eb52599 + 1b536a4 commit 2f8851d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion iCloud/iCloud.m
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ - (void)enumerateCloudDocuments {

// Setup iCloud Metadata Query
[query setSearchScopes:@[NSMetadataQueryUbiquitousDocumentsScope]];
[query setPredicate:[NSPredicate predicateWithFormat:[NSString stringWithFormat:@"%%K like '*.%@'", fileExtension], NSMetadataItemFSNameKey]];
[query setPredicate:[NSPredicate predicateWithFormat:[NSString stringWithFormat:@"%%K.pathExtension LIKE '%@'", fileExtension], NSMetadataItemFSNameKey]];

// Pull a list of all the documents in the cloud
[notificationCenter addObserver:self selector:@selector(startUpdate:) name:NSMetadataQueryDidFinishGatheringNotification object:query];
Expand Down

0 comments on commit 2f8851d

Please sign in to comment.