I am using a MBProgressHUD and I need to show it on window as I want to add many full screen views. I set HUD with a text and when i change the text later, its not changing the text. HUD is a retained property of a singleton class. When i show it on view it allow me to do so. But i need to do it with window.
_HUD = [[MBProgressHUD alloc] initWithWindow:[UIApplication sharedApplication].keyWindow];
[[UIApplication sharedApplication].keyWindow addSubview:_HUD];
_HUD.delegate=self;
_HUD.labelText =HUD_TEXT_LOADING;
_HUD.detailsLabelText =HUD_TEXT_PLEASE_WAIT;
[_HUD show:YES];
This is how i am changing the text
-(void) changeHUDText:(NSString*)text andDetailText:(NSString*) detailText
{
if (_HUD) {
if (text)
_HUD.labelText=text;
if (detailText)
_HUD.detailsLabelText=detailText;
}
}