Skip to content

Commit

Permalink
Updated NSMetadataQuery's predicate to support matching extensionless…
Browse files Browse the repository at this point in the history
… filenames
  • Loading branch information
bgfriend0 committed Jan 24, 2014
1 parent eb52599 commit 1b536a4
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 1b536a4

Please sign in to comment.