NSMutableArray containsObject returns true, but it shouldnt
问题 I found similar questions, but -containsObject is not working like I expect. My problem is the NSMutableArray -containsObject method returns true when it shouldn't, when trying to generate random UNIQUE colors and add to an array. What is the best way to check if NSMutableArray contains an object with same values. NSMutableArray *color_arr=[NSMutableArray array]; UIColor *t; for(int i=0; i<100; i+=1) { int r = arc4random()%256; int g = arc4random()%256; int b = arc4random()%256; t=[UIColor