我有以下代码,并正在尝试访问 iCloud 目录。
(void) reloadFiles{
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *containerID=@"KSC75JA957.Dcdmc.TinyPix";
NSURL *cloudURL = [fileManager URLForUbiquityContainerIdentifier:nil];
NSLog(@"got cloudURL %@", cloudURL);
self.query = [[NSMetadataQuery alloc] init];
query.predicate = [NSPredicate predicateWithFormat:@"%K like '*.tinypix'", NSMetadataItemFSNameKey];
query.searchScopes = [NSArray arrayWithObject:NSMetadataQueryUbiquitousDocumentsScope];
[query startQuery];
}
但是,当我运行我的应用程序时,我无法获取云 url。并收到以下错误。
got cloudURL (null)
item update error: 0, Error
Domain=LibrarianErrorDomain Code=10 "The operation couldn’t be completed.
(LibrarianErrorDomain error 10 - Unable to configure the collection.)"
UserInfo=0xce65470 {NSDescription=Unable to configure the collection.}