UIAlertView が閉じられた後、ビューをリロードしたいと思います (viewWillDisappear
ビューとビューに対して実行しviewWillAppear
ます)。
それ、どうやったら出来るの?nil と self の両方に委任しようとしました。これが私のコードです。
- (IBAction)doStuffWhenUIButtonIsClicked:(id)sender
{
int intSelection = [sender tag];
NSString* strAlertTitle;
NSString* strAlertMessage;
if (intSelection == self.intCorrectChoice) {
strAlertTitle = @"Correct tag!";
}
else {
strAlertTitle = @"Sorry, incorrect tag!";
}
strAlertMessage = @"The correct answer was 8.";
self.answerReaction = [[UIAlertView alloc]
initWithTitle: strAlertTitle
message: strAlertMessage
delegate: nil
cancelButtonTitle:@"Next Question"
otherButtonTitles:nil];
[self.answerReaction show];
}
ご覧のとおり、ユーザーがいずれかの質問に回答した後、新しい質問をロードしたいと考えています。