0

I created a UIColor object and put it into an instant variable called color:

color = [UIColor whiteColor];

Now I use an if statement to test whether this color is equivalent to another color:

if (color == [UIColor whiteColor]) {
    NSLog(@"Color is equivalent");
}

But this NSLog was never called. Is there a way to test whether two color are the same?

Tom Shen
  • 1,838
  • 3
  • 19
  • 40

1 Answers1

0

Try [color isEqual:anotherColor]

weiyin
  • 6,819
  • 4
  • 47
  • 58