iOS ,Objective-c,Image from gallery : when I upload the image on image view it selected from gallery and display on image view but when I click back button and again open push to the image view controller that image is empty, what should I do to remain same image on image view after logout also?
I have used this code 

  
- (void)viewDidLoad {
    NSString *myGrrabedImage1=@"myGrrabedImage1.png";
    NSArray *path=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentDirectory1=[path objectAtIndex:0];
    NSString *fullPathToFile1=[documentDirectory1 stringByAppendingPathComponent:myGrrabedImage1];
    NSData *data=[NSData dataWithContentsOfFile:fullPathToFile1];
    [[self teacherImg]setImage:[UIImage imageWithData:data]];
    [data writeToFile:fullPathToFile1 atomically:YES];
}
- (IBAction)selectImg:(id)sender {
    
    pickerController = [[UIImagePickerController alloc]init];
    pickerController.delegate = self;
    
    [self.imagePicker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
    
    
    UIImage * img = [info valueForKey:UIImagePickerControllerEditedImage];
    
    teacherImg.image = img;
    
    [self presentViewController:pickerController animated:YES completion:nil];

}


- (void) imagePickerController:(UIImagePickerController *)picker
         didFinishPickingImage:(UIImage *)image

                   editingInfo:(NSDictionary *)editingInfo
{
    
    
        NSData *data=UIImagePNGRepresentation(teacherImg.image);
        NSString *myGrrabedImage1=@"myGrrabedImage1.png";
        NSArray *path=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        NSString *documentDirectory1=[path objectAtIndex:0];
        NSString *fullPathToFile=[documentDirectory1 stringByAppendingPathComponent:myGrrabedImage1];
        [data writeToFile:fullPathToFile atomically:YES];
    
    
    
        imagePicker.allowsEditing = YES;
        imagePicker.delegate = self;
    
    
    
    
    
    
    
        
        [[self teacherImg]setImage:image];
        
    
    [self dismissViewControllerAnimated:YES completion:nil];
    
}

