The following code works perfectly from iOS 5 to 6.1. I even have applications in store with that code:
-(void)showActivityIndicator { if(!mLoadingView)
now addSubview is not available in UIAlertView in iOS7
addSubview
UIAlertView
The UIAlertView class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified
As an alternative you can use SVProgressHUD.