0

It seems that QLPreViewController's method +canPreviewItem doesn't work.

I've under currentAttachment value path to xls document, but it's xlsx document.

if (![QLPreviewController canPreviewItem:[NSURL fileURLWithPath:self.currentAttachment]])
{
  NSLog(@"Can't Preview Item");
}

The methods returns YES, but preview is not generated.

So it's xlsx file saved as xls. And i'm trying to understand can I preview it or not, if not I'm trying to preview xlsx file etc.

But always it says that I can.

Tunyk Pavel
  • 2,473
  • 6
  • 31
  • 46
  • If it is an `xlsx` file, save it as an `xlsx` file and not an `xls` file. Those are two different kinds of files. `xls` is a binary file while `xlsx` is a zip file full of xml files. – rmaddy Nov 18 '13 at 15:41
  • Yes, thanks, I understand that, but problem that this broken files are coming to the app (exchange attachment), and before saving them to the system, I can assume only by filename that it's xls. – Tunyk Pavel Nov 19 '13 at 08:31
  • Anyway, problem is solved, I'll add it later. – Tunyk Pavel Nov 19 '13 at 08:45

1 Answers1

-1

try if(![QLPreviewController canPreviewItem:myPreviewItem.currentPreviewItem]) { NSLog(@"Can't preview item");

cnf
  • 34
  • 3