You shouldn't use operator == for comparing floating-point numbers (float, double, CGFloat etc) because of the way the number is stored (rounding etc). Instead what you should do is compare if the color components are in a certain range of each other. I think 1.0/255.0 should be ok.
So what you should do is
const CGFloat kRange = 1.0/255.0;
if (fabs(redA - redB) < kRange &&
fabs(greenA - greenB) < kRange &&
fabs(blueA - blueB) < kRange &&
fabs(alphaA - alphaB) < kRange)
{
return true;
}
else
{
return false;
}