Menu
  • HOME
  • TAGS

Download files from UIDocumentPicker and wait until download has finished

objective-c,xcode,ios8,download,uidocumentpickervc

The file actually is downloaded, but you need to use a file coordinator to read the file contents. Something like this should do: - (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentAtURL:(NSURL *)url { NSFileCoordinator *coordinator = [[NSFileCoordinator alloc] initWithFilePresenter:nil]; NSError *error = nil; [coordinator coordinateReadingItemAtURL:url options:0 error:&error byAccessor:^(NSURL *newURL) { NSData *data = [NSData...

Unable to import pages and numbers documents with UIDocumentPicker

objective-c,file,ios8,file-import,uidocumentpickervc

Even I did not test it, but likely you get the problems, because documents of type .pages or .numbers are no single files, but bundles. So you cannot read them with -dataWithContentsOfURL:. Did you check copying with -copyItemAtURL:toURL:error: (NSFileManager)?...