UIButton の UIImageView を画像に設定していますが、何かが読み込まれている場合はその画像を非表示にしています。次に、画像ビューがあった場所に UIActivityIndicatorView を追加しています。ただし、ボタンのタイトルをタッチすると、非表示のプロパティを変更せずに画像ビューが突然表示されます。コメントアウトしたので、ボタンに追加したセレクター/ターゲットとは何の関係もありません。
ボタンの作成:
[button setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
[button setTitleColor:[UIColor blueColor] forState:UIControlStateSelected];
[button setTitle:buttonTitles[i] forState:UIControlStateNormal];
[button setImage:[UIImage imageNamed:buttonTitles[i]] forState:UIControlStateNormal];
ボタン カテゴリにインジケーター ビューを追加する:
UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
[indicator startAnimating];
indicator.frame = self.imageView.frame;
[self addSubview:indicator];
self.imageView.hidden = YES;