I am creating an application in which i save the thumbnails from the browser. Everything is working fine till i tend to move the directory containing this file into the other directory. It give this error:
ImageIO: CGImageRead_mapData 'open' failed '/Users/anuj/Library/Application Support/iPhone Simulator/6.1/Applications/8CD8EB07-6D62-4284-B425-087E821098BC/Library/Caches/PausedVideos/Old School vs. New School/Thumbnail' error = 2 (No such file or directory) ImageIO: CGImageRead_mapData 'open' failed '/Users/anuj/Library/Application Support/iPhone Simulator/6.1/Applications/8CD8EB07-6D62-4284-B425-087E821098BC/Library/Caches/PausedVideos/Old School vs. New School/Thumbnail' error = 2 (No such file or directory) libpng error: No IDATs written into file
Heres the code that i am using:
NSData *data = [NSData dataWithData:UIImagePNGRepresentation(video.Thumbnail)];
Thumbnail = [[UIImage imageWithData:data] retain];
I also referred to the link here but that doesn't changed anything.