다음 코드 조각이 있으며 iCloud 디렉토리에 액세스하려고합니다.iCloud 기본 URL이 null
(void) reloadFiles{
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *[email protected]"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.}
cloudURL을 (를) 사용 하시겠습니까? 그렇다면 NIL 식별자와 관련이있을 수 있습니다. – doge
'nil'대신 컨테이너 식별자를 사용하려고했지만 여전히 동일한 오류가 발생합니다. 그래서 나는 그것이 문제가 아니라고 생각한다. – Amrita
'cloudURL'이 'nil'인 경우 iCould 서비스를 사용할 수 없다는 의미입니다. – holex