我想在单击时隐藏按钮 loadImgButton 。此按钮将调用以下方法:
- (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!