I would like to read a list of all the directories created by the user or application in the iCloud Mobile Documents directory (the one found in Lion under ~ / Library / Mobile Documents). Here is an example of what this directory looks like:

I tried the following code, but the query that I run will not contain any objects representing my folders (using NSPredicate predicateWithFormat:@"%K.pathExtension = ''", NSMetadataItemFSNameKey ). If I run a query for txt files (using @"%K ENDSWITH '.txt'", NSMetadataItemFSNameKey ), I get 5 objects returned for txt files respectively. Thus, txt file search works, but not for directories. After reading the docs , I noticed that Apple suggests using NSFileWrapper (File Packages) instead of directories. Is iCloud unable to process / detect directories created by the user or application?
Here is my code:
-(void)loadDocument { NSMetadataQuery *query = [[NSMetadataQuery alloc] init]; _query = query;
source share