I have a simple UIView *myView which is set as follows
myView.image = [UIImage imageNamed:[NSString stringWithFormat:@"%d.png", r]];
this takes the index r and gets that image, all works correctly in my two IBAction methods
-(IBAction) previousImageSelector{
if (r != 0)
r = r - 1;
NSLog(@"r is%d",r);
myView.image = [UIImage imageNamed:[NSString stringWithFormat:@"%d.png", r]];
}
I am currently allowing the user to save a picture to their favorites list with a title they input. This all works correctly, the name and index number of the image save to a mutableArray, The trouble comes when the user selects the table item.
My app retrieves the index of the image correctly, sets the index to that and then calls the
myView.image = [UIImage imageNamed:[NSString stringWithFormat:@"%d.png", r]];
but for some reason this doesnt update the view, only the counter, and then if the user selects next or previous image the image after the current counter(the image which should have loaded) loads.
Is there a refresh method or a way to set it differently?
I dont understand why the same method works in the next and previous image IBActions, but not once a table row is selected.
advice please.
Regards