#import/** * 通过UIColor创建UIImage * * @param color 颜色 * * @return UIImage */+ (UIImage*)createImageWithColor:(UIColor *)color { CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f); UIGraphicsBeginImageContext(rect.size); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetFillColorWithColor(context, [color CGColor]); CGContextFillRect(context, rect); UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return theImage;}/** * 判断字符串是否为空 * * @param thestring 字符串 * * @return 是否为空 */+ (BOOL)isEmptyString:(NSString *)thestring { if ( !thestring || thestring == nil || thestring == Nil) { return YES; } if (thestring == nil) { return YES; } if (thestring == NULL) { return YES; } if ([thestring isKindOfClass:[NSNull class]]) { return YES; } if ([thestring isEqual:[NSNull null]]) { return YES; } if ([thestring isEqualToString:@" "]) { return YES; } if ([thestring isEqualToString:@"(null)"]) { return YES; } if ([[thestring stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length]==0) { return YES; } return NO;}