CGColorSpaceRef colorSpace = CGImageGetColorSpace([UIImage imageNamed:@"shirtWhite.jpeg"]);
CGContextRef context = CGBitmapContextCreate (nil,
width,
height,
CGImageGetBitsPerComponent(imageToTest.image),
CGImageGetBytesPerRow(imageToTest.image),
colorSpace,
CGImageGetAlphaInfo(imageToTest.image));
I got the warning on each line where I am passing the image.
The warning is ” warning: passing argument 1 of ‘CGImageGetColorSpace’ from incompatible pointer type
warning: passing argument 1 of ‘CGImageGetBitsPerComponent’ from incompatible pointer type
“
Solved: pass CGImage instead of image