#import "MBProgressHUD.h" @interface UploadDesViewController : UIViewController<MBProgressHUDDelegate>{ MBProgressHUD *HUD; } @property (retain, nonatomic) MBProgressHUD *HUD;
.m
@synthesize HUD;
self.HUD = [[[MBProgressHUD alloc] initWithView:self.view] autorelease]; [self.view addSubview:HUD]; HUD.delegate = self; HUD.labelText = @"正在上传。。。"; [HUD show:YES]; HUD.labelText = @"上传成功"; [HUD hide:YES afterDelay:1.0]; self.HUD = nil; HUD.labelText = @"上传失败"; [HUD hide:YES afterDelay:1.0]; self.HUD = nil;