0

i'm using quicklook to preview an image saved locally. when i run the app, quicklook read the right file and has the right image memory but doesn't preview it. it shows me something like this.

enter image description here

in my code i'm passing an NSURL to this delegate method

(id)previewController:(QLPreviewController *)previewController previewItemAtIndex:(NSInteger)idx so i guess everything is in place. but what could i missing?

EDIT: to creath the path i do it by the following:

filePath = [NSString stringWithFormat:@"%@/LeBaccPictureDownloadedTemperoraly", [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]];

and in the delegate method i mentioned i return the url by this:

[NSURL fileURLWithPath:filePath];
HusseinB
  • 1,321
  • 1
  • 17
  • 41
  • Show me the code you create the local URL. Do you use `urlWithString:`? Try [NSURL fileURLWithPath: path]. – rcpfuchs Sep 18 '13 at 17:29
  • please find the code above – HusseinB Sep 18 '13 at 17:37
  • 1
    does `filePath = [@"~/Documents/LeBaccPictureDownloadedTemperoraly" stringByExpandingTildeInPath];` change anything? Does the file have an extension? Try to show the file in an UIImageView to make sure the file is not broken. – rcpfuchs Sep 18 '13 at 18:20
  • i missed the file format :/ add it as an answer to choose it as a correct one. thank you so much! – HusseinB Sep 19 '13 at 02:10

1 Answers1

2

does filePath = [@"~/Documents/LeBaccPictureDownloadedTemperoraly" stringByExpandingTildeInPath]; change anything? Does the file have an extension? Try to show the file in an UIImageView to make sure the file is not broken. Whatch the file format xD

Like this?

rcpfuchs
  • 792
  • 1
  • 12
  • 26