Question: I am using a `UIAlertView` to prompt users for a password. If the password is correct, I'd like the alert view to go away normally; if the password is incorrect, I'd like the alert view to remain (with the text changed to something like "Please try again."). How do I alter the default behaviour so that the view doesn't go away when a button is pressed?

I've tried the subclassing method suggested at [Is it possible to NOT dismiss a UIAlertView](https://stackoverflow.com/questions/2051402/is-it-possible-to-not-dismiss-a-uialertview), but the `dismissWithClickedButtonIndex` wasn't being called in my subclass. After reading the documentation I see that subclassing `UIAlertView` isn't supported, so I'd like to try another approach.

If this isn't possible with `UIAlertView`, is the best option to simply make a password view from scratch? Thanks for reading.

Answer: 
You could design a **UIView** similar to the alertview and can cal the functions inside this. Removing a UIView is controlled by you.
It's not possible to leave the alert there when a button has been clicked.

You can either disable the "OK" button by delegate method `alertViewShouldEnableFirstOtherButton:`, if you are checking the password locally, or just show another alert later. The second alert can contain a different information, e.g. "Password incorrect" instead of "Enter password".