I can set UIColor objects as keys in NSMutableDictionary all day long, and all is well and happily ...
For instance:
[myDict setObject:foo forKey:[UIColor redColor]]
This works fine ... IF I try to use the following:
UIColor *black = [[UIColor alloc] initWithRed:0 green:0 blue:0 alpha:1];
[myDict setObject:foo forKey:black];
It always gives me:
- [UIDeviceRGBColor copyWithZone:]: unrecognized selector sent to instance 0x691be80
The reasons why I define black in the RGB color space do not matter for this question, just know that I have to define it that way. I donโt understand why this and this color alone is causing me a problem, and why is the error a copyWithZone error?
For recording, [UIColor blackColor] works like a key, but since it is not an RGB color space, it is not suitable for my application.