just as you write, you can get the data, suppose you want to get the image from the document folder, and then see this code -
NSString *stringPath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)objectAtIndex:0]]; NSString *fileName = [stringPath stringByAppendingFormat:@"/image.jpg"];
in this case instead
[data writeToFile:fileName atomically:YES]
you need to write
NSData *retrieveData = [NSData dataWithContentsOfFile:fileName];
lines. And you can get all kinds of data.
Thanks!
TheTiger
source share