UIAlertView關閉後,我想重新加載視圖(對視圖運行viewWillDisappear
,對視圖運行viewWillAppear
)。如何在UIAlertView關閉後重新載入視圖?
我該怎麼做?我曾嘗試委託給無和自我。這是我的代碼。
- (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];
}
如您所見,我想在用戶回答其中一個問題後加載一個新問題。