Xcode5.0で作成したプロジェクトに大量の警告が入るが、
プロジェクトのクリアをすれば警告が直る。
- (void)viewDidLoad
{
[super viewDidLoad];
UIImage *image = [self createImageFromUIColor:[UIColor blackColor]];
}
- (UIImage *)createImageFromUIColor:(UIColor *)color
{
//1x1のBitmapを作成する
CGRect rect = CGRectMake(0, 0, 1, 1);
UIGraphicsBeginImageContext(rect.size);
CGContextRef contextRef = UIGraphicsGetCurrentContext();
//Bitmapを塗りつぶし
CGContextSetFillColorWithColor(contextRef, [color CGColor]);
CGContextFillRect(contextRef, rect);
//UIImageに変換
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
};