0
votes

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];
1
Show me the code you create the local URL. Do you use urlWithString:? Try [NSURL fileURLWithPath: path].rcpfuchs
please find the code aboveHusseinB
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
i missed the file format :/ add it as an answer to choose it as a correct one. thank you so much!HusseinB

1 Answers

2
votes

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?