我從採摘的iCloud和谷歌文檔等驅動,並使用這種方法- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentAtURL:(NSURL *)url
獲取錯誤 - (BOOL)copyItemAtURL:(NSURL *)srcURL的toURL:(NSURL *)dstURL錯誤:(NSError **)錯誤
我收到網址file:///private/var/mobile/Containers/Data/Application/34C6FC23-C8BF-407E-AD67-77758BD606E9/tmp/com.company.theApp-Inbox/chart%20(1).pdf
,但是當我這樣做[[NSFileManager defaultManager]copyItemAtURL:url toURL:docUrl error:&error];
我收到此錯誤Error Domain=NSCocoaErrorDomain Code=262 "The file couldn’t be opened because the specified URL type isn’t supported." UserInfo={NSURL=/var/mobile/Containers/Data/Application/34C6FC23-C8BF-407E-AD67-77758BD606E9/Documents/documents/12345678901-1470638583.pdf}
,這是我docUrl = /var/mobile/Containers/Data/Application/34C6FC23-C8BF-407E-AD67-77758BD606E9/Documents/documents/12345678901-1470638583.pdf
這是我在做什麼NSURL * docUrl = [NSURL URLWithString:[documentFolderDataPath stringByAppendingPathComponent:FN]]; –
如果你改變它:'NSURL * docUrl = [NSURL fileURLWithPath:[documentFolderDataPath stringByAppendingPathComponent:fn]];'? – Roy
非常感謝:) ..... –