Using OCUnit to test if an UIAlertView is presented
I'm working on an app that will display a UIAlertView upon hitting it's exit button, only if progress in the game has been made. I was wondering how you would use OCUnit to intercept the UIAlertView and interact with it, or even detect if it has been presented. The only thing I can think of is to monkeypatch [UIAlertViewDelegate willPresentAlertView] , but that makes me want to cry. Does anyone know of a better method of doing this? Update : See my blog post How to Unit Test Your Alerts and Action Sheets The problem with my other answer is that the -showAlertWithMessage: method itself is never