사용자가 경고가있는 단추를 클릭 할 때 팝업을 표시하려고 시도하고 취소를 클릭하면 해제되지만 계속을 클릭하면 뷰 컨트롤러를 제시하고 싶습니다. 여기에 내 코드가 있지만 버튼을 누를 때마다 팝업이 닫히기 만합니다.팝업 코드에 반응하는 코드에 어떤 문제가 있습니까?
- (IBAction)latest:(id)sender {
alert = [[UIAlertView alloc] initWithTitle:@"WARNING" message:@"Continuing will use internet and may cause app to slow down in large crowds" delegate:nil cancelButtonTitle:@"Cancel" otherButtonTitles:@"Continue", nil];
[alert show];
}
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex == 2) {
UIViewController *NVC = [self.storyboard instantiateViewControllerWithIdentifier:@"Latest"];
[self presentViewController:NVC animated:YES completion:Nil];
}
}
감사합니다. – user2578110