Silver Challange: UIImageView not refreshing immediatelly


#1

Hi all, i need help

I completely understand the challenge but my image isnt refreshing after setting to NIL in the method deletePicture.
To see the difference i need to go back to ItemsViewController and then again in DetailViewController to see there is no image for that item.

How to setup method to refresh UIImageView immediately after pressing delete buthon?

Thank you


#2

[imageView setImage:nil] doesn’t work?


#3

The same was happening for me… I don’t know if this is correct way but I got it to work by using viewWillAppear

- (IBAction)removePicture:(id)sender {
    NSString *imageKey = [item imageKey];
    
    [[BNRImageStore sharedStore] deleteImageForKey];
    [self viewWillAppear:YES];
}

#4

Here is my code and it works as it should, hope it helps

[code]

  • (IBAction)removePicture:(id)sender {
    [[BNRImageStore sharedStore] deleteImageForKey:_item.imageKey];
    [_item setImageKey:nil];
    [_imageView setImage:nil];
    }[/code]