I solved my problem using CGColorGetComponents
, but I would like to understand exactly what is the reason.
I did the following with an instance of UIColor *firstColour
:
[firstColour getRed:&r green:&g blue:&b alpha:nil]
This worked great on a simulator. Then I tested it on my device and got this error:
UIDeviceRGBColor getRed: green: blue: alpha unrecognized selector sent to the instance
After some research on the Internet, I found that UIColor
actually replaced by subclasses, such as UIDeviceRGBColor
. Ok, but shouldn't subclasses work the same as UIColor
and accept (at least) the same methods?
I turned on Zombie, but apparently this is not a memory management issue, as most people say on the forums. And I can not find the documentation for UIDeviceRGBColor
, so I do not know how it should behave. Does anyone know why this happened, and above all, if it is likely to repeat with another method?
Thanks.
source share