The following code works perfectly from iOS 5 to 6.1. I even have applications in store with that code:
-(void)showActivityIndicator { if(!mLoadingView)
From iOS 7 onwards, you can do:
[alertView setValue:customContentView forKey:@"accessoryView"];
to get custom content in a standard alert view.