私が作業しているアプリには、他のアクションに比べて比較的長い時間がかかる機能が 1 つあります。関数の実行中に画像を表示して、アプリがまだ正常に動作していることをユーザーに示したいと思います。
私がそれを行うことができる方法は次のとおりです。
_checkImpossibleImage.hidden = NO;
bool ratioIsPossible = [PaintGame isPossible:_paintChipRatio:_paintCanRatios];
_checkImpossibleImage.hidden = YES;
本質的には、画像を表示に設定し、関数を実行してから、画像を非表示に設定します。ただし、このセクションのすべてのコードが実行されるまで、ビューは更新されないようです。全体的な機能は次のとおりです。
- (void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == 0){
// Do nothing (cancel option selected)
} else {
if (_buttonKey == @"New") {
_checkImpossibleImage.hidden = NO;
bool ratioIsPossible = [PaintGame isPossible:_paintChipRatio:_paintCanRatios];
_checkImpossibleImage.hidden = YES;
...
}
...
}
}
現在のビューを強制的に更新する方法はありますか、または関数の実行中に「読み込み」ポップアップを作成するより良い方法はありますか?