嗨,大家好,我有這個我IBAction爲連接到一個按鈕:clickedButtonAtIndex:不工作
- (IBAction)showCurl:(id)sender {
alert1 = [[UIAlertView alloc]initWithTitle:@"Loading" message:nil delegate:self cancelButtonTitle:nil otherButtonTitles:nil];
[alert1 show];
}
和clickedButtonIndex自動運行但不知何故,它不會加載SecondViewController:
#pragma mark UIAlertView
- (void)alertView:(UIAlertView *)alert1 clickedButtonAtIndex:(NSInteger)buttonIndex {
if(buttonIndex == 0){
SecondViewController *sampleView = [[SecondController alloc] init];
[sampleView setModalTransitionStyle:UIModalTransitionStylePartialCurl];
[self presentModalViewController:sampleView animated:YES];
}
else{
// Cancel prompt
}
}
我在這裏錯過了什麼?
什麼問題?警報是否顯示?如果是這樣,是否調用了委託方法? –
顯示警告,但不會切換到反映在 - (void)alertView中的SecondViewController:(UIAlertView *)alert1 clickedButtonAtIndex:(NSInteger)buttonIndex {' –