Load iCloud document from subFolder in iOS
I have successfully created Folder named Note in iCloud.
I know the way to load files from iCloud Document directory.
But i don't know how to load from Notes Folders.
I only want to load all documents from Note Folder. not from Document
directory.
The directory path is like that : "iCloud>Documents>Notes"
Here is some of my codes that load data from iCloud Document Folder.
[self.notes removeAllObjects];
NSMutableArray* tmpFileList = [[NSMutableArray alloc] init];
for (NSMetadataItem *item in [query results])
{
NSURL *url = [item valueForAttribute:NSMetadataItemURLKey];
Note *doc = [[Note alloc] initWithFileURL:url];
doc.lastModDate = [item
valueForAttribute:NSMetadataItemFSContentChangeDateKey];
[tmpFileList addObject:doc];
}
NSSortDescriptor *descriptor = [NSSortDescriptor
sortDescriptorWithKey:@"lastModDate" ascending:NO];
self.notes = [NSMutableArray arrayWithArray:[tmpFileList
sortedArrayUsingDescriptors:[NSArray arrayWithObject:descriptor]]];
[self.tblMainTableView reloadData];
How can i load it?
No comments:
Post a Comment