I want to hide the button loadImgButton when I click it. This button will call the method below:
- (IBAction)produceImage:(id)sender
{
[loadImgButton setHidden:YES];
[image1 setImage:[UIImage imageNamed:@"Fanny2.JPG"]];
[image2 setImage:[UIImage imageNamed:@"Fanny3.JPG"]];
NSLog(@"i am here");
for (int i = 0; i < 100000; i++) {
for(int j = 0;j < 10000; j++) {
}
}
}
The problem is that the button is not hidden and the image is not set until the function is finish. What is the reason cause this situation and how to fix it? Thanks!