ユーザーが警告付きのボタンをクリックしたときにポップアップを表示しようとしています。キャンセルをクリックすると閉じられますが、続行をクリックするとView Controllerが表示されます。これが私のコードですが、どのボタンを押してもポップアップを閉じるだけです:
- (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];
}
}