About the destruction of alertwindow!

hello everyone! There are several questions about alertwindow. I customized an alert window with three buttons. Why do pressing these three buttons destroy the alertwindow? I think two buttons can destroy alertwindow, and one button cannot destroy alertwindow. How to solve this problem? Another question is, when I pop up an alert window in the alert window, why should I destroy two alert windows when I click OK instead of the one just popped up?
Can anyone help me,please?
Thanks all.