MWPhotoBrowser code update with directory

87 views Asked by At

I am using the github project called MWPhotoBrowser that pulls image files from the web into a gallery on the iPhone. The problem is the code calls for the specific url of the image file. I want to pull images from inside a directory. Any ideas on how this can be done? Here's part of the code.

[photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:@"http://farm4.static.flickr.com/3567/3523321514_371d9ac42f_b.jpg"]]];
1

There are 1 answers

0
Andy Obusek On

This solution involves use of the NSURL API is it can be used for web or local resources:

NSString *filePath = //path to your file
NSURL *filePathURL = [[NSURL alloc] initFileURLWithPath:filePath];
[photos addObject:[MWPhoto photoWithURL:filePathURL]];