//RGB直接转UIColor,方便死了有木有。这个是从破船blog里面学习到的,船哥不要K我啊。。
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
//嘎嘎,自己定义的弹出Alert框和HUD
#define showAlert(_msg){UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:_msg delegate:nil cancelButtonTitle:nil otherButtonTitles:@"确定",nil];[alert show];}
#define showHUDInfo(text){self.HUD = [[MBProgressHUD alloc] initWithView:self.view];[self.view addSubview:self.HUD];self.HUD.delegate = self;self.HUD.mode = MBProgressHUDModeText;self.HUD.labelText = text;[self.HUD showAnimated:YES whileExecutingBlock:^{sleep(2);}completionBlock:^{[self.HUD removeFromSuperview];self.HUD = nil;}];}
//iOS7兼容要用的,后面7.0替换一下可以改成任意版本。
#define ISIOS7 ([[[UIDevice currentDevice] systemVersion] floatValue]>=7.0)
//判断是iphone还是ipad
#define IS_PAD ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
#define IS_PHONE ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
//嘎嘎,自己定义的弹出Alert框和HUD
#define showAlert(_msg){UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:_msg delegate:nil cancelButtonTitle:nil otherButtonTitles:@"确定",nil];[alert show];}
#define showHUDInfo(text){self.HUD = [[MBProgressHUD alloc] initWithView:self.view];[self.view addSubview:self.HUD];self.HUD.delegate = self;self.HUD.mode = MBProgressHUDModeText;self.HUD.labelText = text;[self.HUD showAnimated:YES whileExecutingBlock:^{sleep(2);}completionBlock:^{[self.HUD removeFromSuperview];self.HUD = nil;}];}
//iOS7兼容要用的,后面7.0替换一下可以改成任意版本。
#define ISIOS7 ([[[UIDevice currentDevice] systemVersion] floatValue]>=7.0)
//判断是iphone还是ipad
#define IS_PAD ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
#define IS_PHONE ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)