I wanted to add a view in UIWindow with following code:
UIWindow
AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate; UIWindo
UIAlertView creates another UIWindow and set this window as key window when you call show method. So if you want to show your own alert view create a UIWindow instance show it and add your custom alert view to this newly created window.