如果我使用这段代码,就会出现错误。
+ (UIImage *)createImageWithColor:(UIColor *)color size:(CGSize)size
{
CGRect rect = CGRectMake(0.0, 0.0,size.width,size.height);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [color CGColor]);
CGContextFillRect(context, rect);
UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return theImage;
}
错误日志。不崩溃,与状态栏无关。