Показать MBProgressHUD Используйте этот код: -
HUD = [[MBProgressHUD alloc] init];
[self.view addSubview:HUD];
HUD.delegate = self;
[HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];
where myTask is
- (void)myTask
{
"Your Code"
}
И тоже Скрыть MBProgressHud
- (void)hudWasHidden:(MBProgressHUD *)hud
{
// Remove HUD from screen when the HUD was hidded
[HUD removeFromSuperview];
[HUD release];
HUD = nil;
}
И если вы хотите продемонстрировать непристойность с помощью CostomView, используйте этот код
HUD = [[MBProgressHUD alloc] init];
[self.view addSubview:HUD];
// Make the customViews 37 by 37 pixels for best results (those are the bounds of the build-in progress indicators)
HUD.customView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Your Image Name.png"]] autorelease];
// Set custom view mode
HUD.mode = MBProgressHUDModeCustomView;
HUD.delegate = self;
HUD.labelText = @"Completed";
[HUD show:YES];
[HUD hide:YES afterDelay:3];
}