クリックしたときにボタン 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!