How to load a UIImage that we’ve previously saved

    // first we get the path to our image
    NSString *imagePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/myImage.jpg"];
    
    // now we can load and display the file like this
    self.myPicture.image = [UIImage imageWithContentsOfFile:imagePath];




One thought on “How to load a UIImage that we’ve previously saved

  1. To test if the file exists we can check the following:

    BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:[NSHomeDirectory()stringByAppendingPathComponent:imagePath]];
    

Leave a Reply