关闭 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];
}
如您所见,我想在用户回答其中一个问题后加载一个新问题。