I'm trying to compare the text colour in a UIlabel with a UIColor but the result is always false.
The following code produces the result:
color equal 1, 0
I expect both a and b to be equal to 1. Is there another way to do this compare?
bool a,b;
UIColor *myColor1, *myColor2;
myColor1 = [UIColor redColor];
mainViewController.timerLabel.textColor = [UIColor redColor];
myColor2 = [UIColor colorWithCGColor:mainViewController.timerLabel.textColor.CGColor];
a = [[UIColor redColor] isEqual:myColor1];
b = [[UIColor redColor] isEqual:myColor2];
NSLog(@"color equal %i, %i",a,b);