トピックが重複していたら申し訳ありませんが、解決策が見つかりませんでした。私はいくつかの計算をしようとしていますが、それらを実行している間、スワイプした直後にユーザーにアクティビティ インジケーターを表示させたいと考えています。ユーザーには、インジケーターが表示され、textView と結果が表示されるのを待つ必要があります。私が書いたものを使用すると、インジケーターが表示されません(表示されて同時に消えると思います)。計算が開始される前にそれを表示し、計算の最後に非表示にする方法は?
-(IBAction)swipeRight:(UISwipeGestureRecognizer *) recognizer {
activityIndicator.hidden = NO;
[activityIndicator startAnimating];
//some calculations are being done here
textViewInfo.text = [NSString stringWithFormat:@"results of long calculations..."];
textViewInfo.alpha = 1;
activityIndicator.hidden = YES;
[activityIndicator stopAnimating];
}